Apache Solr is an open-source search platform written on Java. Solr provides full-text search, spell suggestions, custom document ordering and ranking, Snippet generation, and highlighting. This tutorial will help you to install Apache Solr 8.9 on Fedora 34/33/32/31/30, CentOS/RHEL 7/6 systems.
Step 1 – Prerequsities
Apache Solr 8 required Java 8 or greater to run. Make sure your system fulfills the Java requirements of Apache Solr. If you don’t have java installed on your system, use our tutorials to Install Java 11.
java -version java version "11.0.2" 2019-01-15 LTS Java(TM) SE Runtime Environment 18.9 (build 11.0.2+9-LTS) Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+9-LTS, mixed mode)
Step 2 – Install Apache Solr on CentOS
Now download the required Solr version from its official site or mirrors. You may also use the below command to download Apache Solr 8.9.0 from its official website. After that extract the installer script.
cd /tmp wget https://downloads.apache.org/lucene/solr/8.9.0/solr-8.9.0.tgz tar xzf solr-8.9.0.tgz solr-8.9.0/bin/install_solr_service.sh --strip-components=2
Then execute the installer script with bash shell followed with downloaded Archive file. The command will be like below:
sudo bash ./install_solr_service.sh solr-8.9.0.tgz
This will create a user with the name solr in your system and finish the installation process. After that start the service default Solr port 8983.
Step 3 – Manage Solr Service
Use the following commands to Start, Stop and check the status of the Solr service.
For SysVinit Users –
sudo service solr stop sudo service solr start sudo service solr status
For Systemd Users –
sudo systemctl stop solr sudo systemctl start solr sudo systemctl status solr
Step 4 – Create Your First Solr Collection
After the successful installation of Apache Solr service on your system. Create your first collection using the following command. You may change the mycol1 with your collection name.
sudo su - solr -c "/usr/local/solr/bin/solr create -c mycol1-n data_driven_schema_configs"
Created new core 'mycol1'
Step 5 – Access Solr Web Admin Panel
Default Solr runs on port 8983. You can access Solr port in your web browser and you will get Solr dashboard.
Here you can view statics of created collection in previous steps named “mycol1”. Click on “Core Selector” on the left sidebar and select created collection.