The following procedure was tested on a test instance in AWS, with Redhat and Solr 6.1.0
. You may need to adjust the process to your operating system and environment accordingly.
Make sure you use RedHat or a similar (Fedora-based) OS.
cat /etc/redhat-release
displays your OS version.
Install Java if necessary
sudo yum list available java*
sudo yum install java-1.8.0-openjdk.x86_64
Check if it is installed correctly
which java
displays the Java home
java -version
displays the Java version
Create a SOLR user.
sudo adduser solr
Enable sudo on the SOLR user, run visudo
sudo visudo
Find the following lines:
## Allows people in group wheel to run all commands
# %wheel ALL=(ALL) ALL
If %wheel
is commented out, uncomment the second line by removing the # character.
%wheel ALL=(ALL) ALL
If you made a change use :wq
otherwise use :q
to quit.
Add the solr user to the wheel group.
sudo usermod -aG wheel solr
Switch over to the solr
user an check if you have root privileges:
su solr -
sudo whoami
Find your local mirror at: http://www.apache.org/dyn/closer.lua/lucene/solr/
Change your directory location to opt:
cd /opt/
Download a copy of the package from the mirror:
sudo curl -O http://www.trieuvan.com/apache/lucene/solr/6.1.0/solr-6.1.0.tgz
Untar the package:
sudo tar zxvf solr-6.1.0.tgz
Copy the installer script to your folder:
sudo cp /opt/solr-6.1.0/bin/install_solr_service.sh .
Remove the unnecessary files:
sudo rm -rf solr-6.1.0
sudo ./install_solr_service.sh solr-6.1.0.tgz
sudo chkconfig --add solr
chkconfig | grep solr
sudo chown -R solr:solr /var/solr/
sudo su - solr -c "/opt/solr/bin/solr create -c NewCore1 -n data_driven_schema_configs"
http://<solr_server>:8983/solr/#/
sudo service solr restart
http://<solr_server>:8983/solr/#/
Make sure the Admin page reloads and the core reappears after the reboot.sudo service solr status
cd var/solr/data/
ll
ll NewCore1/
mkdir CoreFromWebAdmin
sudo cp -R NewCore1/conf/ CoreFromWebAdmin
<add><doc>
<field name="id">F9V7464-APL-KIT</field>
<field name="name">Belkin Mobile Power Cord for iPod w/ Dock</field>
<field name="manu">Belkin</field>
<!-- Join -->
<field name="manu_id_s">belkin</field>
<field name="cat">electronics</field>
<field name="cat">connector</field>
<field name="features">car power adapter, white</field>
<field name="weight">4.0</field>
<field name="price">19.95</field>
<field name="popularity">1</field>
<field name="inStock">false</field>
<!-- Buffalo store -->
<field name="store">45.18014,-93.87741</field>
<field name="manufacturedate_dt">2005-08-01T16:30:25Z</field>
</doc>
<doc>
<field name="id">IW-032</field>
<field name="name">iPod & iPod Mini USB 2.0 Cable</field>
<field name="manu">Belkin</field>
<!-- Join -->
<field name="manu_id_s">belkin</field>
<field name="cat">electronics</field>
<field name="cat">connector</field>
<field name="features">car power adapter for iPod, white</field>
<field name="weight">2.0</field>
<field name="price">11.50</field>
<field name="popularity">1</field>
<field name="inStock">false</field>
<!-- San Francisco store -->
<field name="store">37.7752,-122.4232</field>
<field name="manufacturedate_dt">2006-02-14T23:55:59Z</field>
</doc>
<doc>
<field name="id">F887464-APL-KIT</field>
<field name="name">Belkin Mobile Power Cord for iPod w/ Dock</field>
<field name="manu">Belkin</field>
<!-- Join -->
<field name="manu_id_s">belkin</field>
<field name="cat">electronics</field>
<field name="cat">connector</field>
<field name="features">car power adapter, black</field>
<field name="weight">4.0</field>
<field name="price">19.95</field>
<field name="popularity">1</field>
<field name="inStock">true</field>
<!-- Buffalo store -->
<field name="store">45.18014,-93.87741</field>
</doc>
<doc>
<field name="id">FAV7464-APL-KIT</field>
<field name="name">Belkin Mobile Power Cord for iPod w/ Dock</field>
<field name="manu">Belkin</field>
<!-- Join -->
<field name="manu_id_s">belkin</field>
<field name="cat">electronics</field>
<field name="cat">connector</field>
<field name="features">car power adapter, blue</field>
<field name="weight">4.0</field>
<field name="price">15.95</field>
<field name="popularity">2</field>
<field name="inStock">true</field>
<!-- Buffalo store -->
<field name="store">45.18014,-93.87741</field>
<field name="manufacturedate_dt">2015-09-21T16:30:25Z</field>
</doc></add>
If your response returns a success, you have successfully installed SOLR and verified your installation.