Apache Solr is an open source search platform developed in Java. It provides useful features such as full-text search, spell suggestions, custom document ordering and ranking, Snippet generation and highlighting. In this tutorial, we will guide you through the Apache Solr 7.5 installation on CentOS/RHEL 7/6, Fedora 28/27/26/25 systems.
Apache Solr is popular because of its advanced features given below:
- Indexing in near real-time
- Automated index replication
- Server statistics logging
- Automated failover and recovery
- Rich document parsing and indexing
- Multiple search indexes
- User-extensible caching
- Design for high-volume traffic
- Scalability, flexibility, and extensibility
- Advanced full-text searching
- Geospatial searching
- Load-balanced querying
Basically, Apache Solr 7 requires Java 8 or greater to run. Make sure that your system fulfills Java requirements of Apache Solr. If you don’t have java installed on your system, use our tutorials to install Java 8.
java -version java version "1.8.0_181" Java(TM) SE Runtime Environment (build 1.8.0_181-b11) Java HotSpot(TM) 64-Bit Server VM (build 25.181-b11, mixed mode)
Install Apache Solr on CentOS
First, we will need to download the required Solr version from its official site or mirrors. We can also use the below command to download Apache Solr 7.5.0 from its official website. Once the package is downloaded, extract the installer script.
wget http://www-eu.apache.org/dist/lucene/solr/7.5.0/solr-7.5.0.tgz tar xzf solr-7.5.0.tgz solr-7.5.0/bin/install_solr_service.sh --strip-components=2
Then we have to execute the installer script with a bash shell followed with the downloaded Archive file as given below:
sudo bash ./install_solr_service.sh solr-7.3.0.tgz
During the installation, an account named solr will be created on your system. Once done with the installation, you have to start the service default Solr port 8983.
Manage Solr Service
You can 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
Step 4 – Create Your First Solr Collection
After successful installation of the Apache Solr service on your system, you can create your first collection using the following command. You may change the collection1 with your collection name.
sudo su - solr -c "/usr/local/solr/bin/solr create -c collection1 -n data_driven_schema_configs"
Created new core 'mycol1'
Step 5 – Access Solr Web Admin Panel
By Default Solr runs on port 8983. You can access Solr port in your web browser to get Solr dashboard.
You can see the statistics of the created collection in the previous steps named “collection1”. For that, you have to click on “Core Selector” on the left sidebar and select the created collection.