Solr Cassandra Contact

Apache Solr Tutorial

Apache Solr TutorialIntroduction to SolrOverview of SolrOverview of LuceneInstallation of SolrSolrCloud ModeSolr Terminology

Installation of Solr

This tutorial will help you to Install Java SE Development Kit 8u131 or update on your system. Following are steps to install Java in RHEL / CentOS.

Step 1: Know the system architecture is 32 bit or 64 bit (Linux x86 or Linux x64) using any one of following linux command.

Know Linux Operating System is 32-bit or 64-bit

$ getconf LONG_BIT
$ arch
$ uname -m
$ uname -a
Step 2: Apache Solr 6.X required Java 8 or greater to run. Make sure your system fulfill Java requirements of Apache solr.

Verify Java Version

$ java -version


java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
Step 3: Download Java SE Development Kit 8 from www.oracle.com and move it to /opt/sware/ directory Now download jdk-8u131-linux-i586.rpm for 32 bit and jdk-8u131-linux-x64.rpm for 64 bit

Download Java SE Development Kit

$ su
$ mkdir -p /opt/sware
$ cd /opt/sware
$ wget --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.rpm
$ rpm -ihv jdk-8u131-linux-x64.rpm
Step 4: Configure JAVA_HOME as an environment variable.

Configuring Linux Environment Variables

$ vim ~/.bashrc

##Now Paste following two line at the end of file and save
export JAVA_HOME=/usr/java/jdk1.8.0_131
export PATH=$JAVA_HOME/bin:$PATH

##Now reload .bashrc
$ source ~/.bashrc
Step 5: Now download the latest solr version from its official site or mirrors. Or simply use given below command to download Apache Solr 6.6.5.

Download Apache Solr

$ cd /opt
$ wget https://www-us.apache.org/dist/lucene/solr/6.6.5/solr-6.6.5.tgz
Step 6: Now extract solr service installer shell script from the downloaded Solr archive file and run installer using given below commands.

Install Apache Solr 6.6

$ tar xzf solr-6.6.5.tgz solr-6.6.5/bin/install_solr_service.sh --strip-components=2
$ sudo bash ./install_solr_service.sh solr-6.6.5.tgz
Step 7: Use the following commands to Start, Stop and check status of Solr service.

Start / Stop Solr Service

$ sudo service solr stop
$ sudo service solr start
$ sudo service solr status
Step 8: After successful installation of Solr on your linux system. Create first collection edututes on solr using given below command.

Create First Solr Collection

$ sudo su - solr -c "/opt/solr/bin/solr create -c edututes -n data_driven_schema_configs"
Step 9: Default Solr runs on port 8983. You can access Solr port in your web browser and you will get Solr dashboard.

Access Solr Admin Panel

http://localhost:8983/
Apache Solr Dashboard