First: I want to learn solr. So I want to execute the quickstart tutorial from http://lucene.apache.org/solr/quickstart.html
On ubuntu 14.04 64 bit I installed solr the following way:
In /opt per wget I took the latest version 6.3.0. This was made as root.
Then I extracted the service installation file by
tar xzf solr-6.3.0.tgz solr-6.3.0/bin/install_solr_service.sh --strip-components=2
Also by root!
I let it run by
sudo ./install_solr_service.sh solr-6.3.0.tgz
that led to user/group solr, started solr as a service, made a symlink from /opt/solr to /opt/solr-6.3.0, made solr.home to /var/solr with user solr as owner etc.
Solr is started as expected so http://localhost:8983/solr/#/ shows me the dash in the browser.
I stop with the usual command
service solr stop
the service to start the examples.
And here the problem:
When I start as root:
root@duke:/opt/solr# bin/solr start -e cloud -noprompt
here the results:
"Welcome to the SolrCloud example!
Starting up 2 Solr nodes for your example SolrCloud cluster.
Solr home directory /opt/solr/example/cloud/node1/solr already exists. /opt/solr/example/cloud/node2 already exists.
Starting up Solr on port 8983 using command: /opt/solr/bin/solr start -cloud -p 8983 -s "/opt/solr/example/cloud/node1/solr"
WARNING: Starting Solr as the root user is a security risk and not considered best practice. Exiting. Please consult the Reference Guide. To override this check, start with argument '-force'
ERROR: Process exited with an error: 1 (Exit value: 1)"
So root is not the correct owner, which I understand because there is a new user solr created.
Then I change to solr as user to start the examples:
solr@duke:/opt/solr$ bin/solr start -e cloud -noprompt
"Welcome to the SolrCloud example!
Starting up 2 Solr nodes for your example SolrCloud cluster.
Creating Solr home directory /opt/solr/example/cloud/node1/solr
ERROR: Destination '/opt/solr/example/cloud/node1/solr' directory cannot be created"
So the first test as root give me no permission because of solr and the second one as user solr give me no permission to create directories/files.
What is to do???
Solr Installation Process
Step 1: Download solr-6.6.0 from the link http://www.apache.org/dyn/closer.lua/lucene/solr/6.6.0
Step 2: Unzip the folder and place it into a proper driver(ie. C drive,D drive)
Step 3:Use windows command prompt to create start solr Solr Command 1.To Start Solr: Go to the active drive where solar-6.6.0 folder is placed then Cd Solr-6.6.0 then cd bin and then Solr Start
The Solr search engine will run under the default port of 8983. Apache Solr can be access by http://localhost:8983/solr/#/ And the interface will be as below
2.To Check the Status of Solr Solr Status
3.To Create Core Admin Under bin folder solr create -c This command will create a core under the folder C:\solr-6.6.0\server\solr
4.Indexing Create a data file in xml format as below and save it in a folder inside solr-6.6.0
Under the xml data file folder, type the below command to create index Java -Dc= -jar post.jar *.xml
5.To Delete Data from the indexed file Under the xml data file folder Java -Ddata=args -Dc= -jar post.jar “id:1”
5a. To Delete Data from the indexed file using solr Documents screen
6.Stop Solr Under bin folder Solr stop -p 8983
7.To Delete a Core Under bin folder solr delete - c corename
When you're running as the Solr user, you'll have to give the
solr
user access to the directory where you're trying to write your configuration. If this is/opt/solr
, you can change the owner of the directory and all contained files recursively by issuing achown
command:This assumes that there's also a group named
solr
on your system. If you don't have a solr group, either use another, suitable group, or leave the last.solr
out of the command.