How to Install Apache Solr in Linux

Solr Apache Solr Install Linux

Apache Solr is a open source search platform built from the Apache Lucence project. Apache Solr is used as powerful text search, database integration, documents handling & clustering.

Apache Solr

Pre-Requisite:-

Pre-requisite for installation of Solr is to have Java installed in the server. Lets check whether java is installed or not using below command

# java -version
java version "1.7.0_91"
OpenJDK Runtime Environment (amzn-2.6.2.2.63.amzn1-x86_64 u91-b00)
OpenJDK 64-Bit Server VM (build 24.91-b01, mixed mode)

If Java is not installed, Follow this blog to install java – How to Install Java JDK in Linux

Installation of Solr in Linux with 5 Easy Steps

Step 1: Download the Solr package

Download the Apache Solr Package from the Apache mirror site using wget command

# cd /opt
# wget http://archive.apache.org/dist/lucene/solr/5.3.1/solr-5.3.1.tgz
# tar -xvzf solr-5.3.1.tgz

Delete the tar.gz file to space the disk space

# rm -f solr-5.3.1.tgz

[adAuto]

Step 2: Configuration to be done!

Copy the Startup Script to /etc/init.d/ &  solr conf file to /var/solr/

# mv solr-5.3.1 solr
# cp /opt/solr/bin/init.d/solr /etc/init.d/
# cp /opt/solr/bin/solr.in.sh /var/solr/

Create Directory for Data directory & Logs

# mkdir -p /var/solr/data
# mkdir /var/solr/logs

Write the configuration below to solr.in.sh file to the End of the file

# vim /var/solr/solr.in.sh
SOLR_PID_DIR=/var/solr
SOLR_HOME=/var/solr/data
LOG4J_PROPS=/var/solr/log4j.properties
SOLR_LOGS_DIR=/var/solr/logs
SOLR_PORT=8983

Step 3: Create Solr user account & Permissions

we need to create solr user account & make the process running as solr as described in init.d/solr script,

# useradd solr
# chown -R solr:solr /opt/solr /var/solr/

YOU MAY ALSO LIKE....

1
Leave a Reply

avatar
166
1 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
1 Comment authors
KeilaSSalehi Recent comment authors
newest oldest most voted
KeilaSSalehi
Guest

Hey there! I recently would like to give you a huge thumbs up for your personal
great info you have here with this post. I’ll be returning to your internet site for more
soon.