Solr is pronounced as Solar. It is an enterprise search platform built on Apache Lucene. Similar type of software is Elastic Search. Elasticsearch is on same Apache Lucene and more commonly used with Kibana, Beats, and Logstash as Elastic Stack for searching, analyzing and visualizing data. Here is how to install Apache Solr 6.x on Ubuntu 16.04. Apache Solr search platform can be integrated with WordPress, CMS & other Softwares.
As example, we can integrate Apache Solr for textual search, hit highlighting, boost through function queries
caching, add auto-suggest, arrange custom ranking and add many other features to WordPress search. Obviously Apache Solr can be used for more extensive usage in conjugation with other Big Data tools.
How To Install Apache Solr 6.x on Ubuntu 16.04
SSH to your server, become root
user. Run :
---
1 2 | apt update -y apt upgrade -y |
Solr is written in Java application, so Java runtime environment needs to be installed. Also, we have to install Python Software properties. Run the following command to install the components :
1 2 | apt install python-software-properties sudo add-apt-repository ppa:webupd8team/java |
Hit Return/Enter key to add repository, then run :
1 | apt update -y |
We will install the latest version of Oracle Java 8 :
1 | apt install oracle-java8-installer |
You will get a TUI prompt to agree to the license to use Oracle Java. After installation, you can verify the version by running :
1 | java -version |
You will current versions of Apache Solr, as example at this mirror :
1 | http://www.us.apache.org/dist/lucene/solr/ |
Which is big sized tgz
file, that you need to wget :
1 2 | cd /tmp wgethttp://www.us.apache.org/dist/lucene/solr/6.6.0/solr-6.6.0.tgz |
This command will extract the service installation file :
1 | tar xzf solr-6.6.0.tgz solr-6.6.0/bin/install_solr_service.sh –strip-components=2 |
Check the files :
1 | ls -al |
This command will install Apache Solr using the extracted script (which we got by running the above command) :
1 | solr-6.6.0/bin/install_solr_service.sh solr-6.6.0.tgz |
You’ll get output like :
1 2 3 4 5 6 7 | ... Creating new user: solr Adding system user `solr' (UID 111) ... Adding new group `solr' (GID 117) ... Adding new user `solr' (UID 111) with group `solr' ... Creating home directory `/var/solr' ... ... |
Run this command. You can read the official documents later to understand why we ran it. exampletutorial
is our chosen named of “collection”, you’ll add own collections later :
1 | sudo su - solr -c "/opt/solr/bin/solr create -c exampletutorial -n data_driven_schema_configs" |
You’ll get output :
1 2 3 4 5 6 7 8 9 10 11 | Copying configuration to new core instance directory: /var/solr/data/exampletutorial Creating new core 'exampletutorial' using command: http://localhost:8983/solr/admin/cores?action=CREATE&name=exampletutorial&instanceDir=exampletutorial { "responseHeader":{ "status":0, "QTime":4427}, "core":"exampletutorial"} |
Apache Solr web interface runs at port 8983 by default. You can visit http://your.server.ip:8983/solr
on browser to view the admin UI.