Apache Solr Installation on Ubuntu 14.04

posted on Nov 20th, 2016

Apache Solr

Apache Solr is an open source enterprise search platform, written in Java, from the Apache Lucene project. Its major features include full-text search, hit highlighting, faceted search, real-time indexing, dynamic clustering, database integration, NoSQL features and rich document (e.g., Word, PDF) handling. Providing distributed search and index replication, Solr is designed for scalability and fault tolerance. Solr is the second-most popular enterprise search engine after Elasticsearch.

Solr runs as a standalone full-text search server. It uses the Lucene Java search library at its core for full-text indexing and search, and has REST-like HTTP/XML and JSON APIs that make it usable from most popular programming languages. Solr's external configuration allows it to be tailored to many types of application without Java coding, and it has a plugin architecture to support more advanced customization.

Pre Requirements

1) A machine with Ubuntu 14.04 LTS operating system installed.

2) Apache Solr 5.4.0 software (Download Here)

Apache Solr Installation

The following steps to install Solr on your machine.

Installation Steps

Step 1 - Installing java 7. Open a terminal (CTRL + ALT + T) and type the following sudo command.

$ sudo apt-get install openjdk-7-jdk

Check it installed properly or not.

$ java -version

Step 2 - Creating solr directory. Open a terminal (CTRL + ALT + T) and type the following sudo command.

$ sudo mkdir /usr/local/solr

Step 3 - Change the ownership and permissions of the directory /usr/local/solr. Here 'hduser' is an Ubuntu username.

$ sudo chown -R hduser /usr/local/solr

$ sudo chmod -R 755 /usr/local/solr

Step 4 - Change the directory to /home/hduser/Desktop , In my case the downloaded solr-5.4.0.tgz file is in /home/hduser/Desktop folder. For you it might be in /downloads folder check it.

$ cd /home/hduser/Desktop/

Step 5 - Untar the solr-5.4.0.tgz file.

$ tar xzf solr-5.4.0.tgz

Step 6 - Move the contents of solr-5.4.0 folder to /usr/local/solr

$ mv solr-5.4.0/* /usr/local/solr

Step 7 - Change the directory to /usr/local/solr

$ cd /usr/local/solr

Step 8 - Starting the Solr.

$ bin/solr start

Step 9 - Check the web UI here. Open a browser and type the following URL.

http://localhost:8983/solr/

Apache Solr Installation on Ubuntu

Step 10 - Stoping the Solr.

$ bin/solr stop

Other ways to start and stop Solr

To start

$ bin/solr start -f

$ bin/solr start -p 8984

To stop

$ bin/solr stop -f

$ bin/solr stop -p 8983

To check status

$ bin/solr status

Help

$ bin/solr -help

$ bin/solr start -help

Please share this blog post and follow me for latest updates on

facebook             google+             twitter             feedburner