Apache Solr is an opensource 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 7.1 on Fedora 27/26/25/24/23, CentOS/RHEL 7/6 systems.
1. Verify Java
Apache Solr 7 required Java 8 or greater to run. Make sure your system fulfill Java requirements of Apache Solr. If you don’t have java installed on your system, use our tutorials to install Java 9 or Java 8.
$ java -version java version "9" Java(TM) SE Runtime Environment (build 9+181) Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode)
2. Download and Install Apache Solr
Now download the required Solr version from its official site or mirrors. You may also use the below command to download Apache Solr 7.3.0 from its official website.
cd /usr/local wget http://www-eu.apache.org/dist/lucene/solr/7.3.0/solr-7.3.0.tgz
Now extract Apache Solr service installer shell script from the downloaded Solr archive file and run the installer using following commands.
tar xzf solr-7.3.0.tgz solr-7.3.0/bin/install_solr_service.sh --strip-components=2 sudo bash ./install_solr_service.sh solr-7.3.0.tgz
3. Start / Stop Solr Service
Use the following commands to Start, Stop and check the status of 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
4. Create Your First Solr Collection
After 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'
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.