Apache Solr, also called “Searching On Lucene w/Replication,” is an open-source REST-API-based search platform built on Apache Lucene Framework. It is written in Java Language and designed for scalability and fault tolerance. Generally, it is used for enterprise search and analytics use cases. It has a lot of features including full-text search, hit highlighting, faceted search, real-time indexing, dynamic clustering, database integration, NoSQL features, and rich document handling. It also supports distributed, replication, sharing, clustering, and multi-node architecture.
In this post, we will show you how to install Apache Solr on Rocky Linux 8.
- A server running Rocky Linux 8 on the Atlantic.Net Cloud Platform
- A root password is configured on your server
Step 1 – Create Atlantic.Net Cloud Server
First, log in to your Atlantic.Net Cloud Server. Create a new server, choosing RockyLinux 8 as the operating system with at least 2GB RAM. Connect to your Cloud Server via SSH and log in using the credentials highlighted at the top of the page.
Once you are logged in to your server, run the following command to update your base system with the latest available packages.
dnf update -y
Step 2 – Install Java JDK
Apache Solr is written in Java, so Java must be installed on your server. If not installed, you can install it with the following command:
dnf install java-11-openjdk -y
Once installed, verify the Java version using the following command:
You should get the following output:
openjdk 11.0.12 2021-07-20 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.12+7-LTS)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.12+7-LTS, mixed mode, sharing)
You will also need to install the EPEL repository on your server. You can install it with the following command:
dnf install epel-release -y
Step 3 – Download Apache Solr
By default, Apache Solr is not included in the Rocky Linux default repository, so you will need to download it from their official website.
You can download it with the following command:
Note: Apache frequently updates SOLR, and you may get an error downloading the above version if it’s been updated since the time of writing. Please check https://downloads.apache.org/lucene/solr/ for the latest versions.
Once Apache Solr is downloaded, download the SHA512 checksum using the following command:
Next, calculate the SHA512 checksum of the Apache Solr downloaded file:
gpg --print-md SHA512 solr-8.10.0-src.tgz.sha512
solr-8.9.0.tgz: 15150B7F 191FD9E8 D2C1BD8B B619DD4B 3F27AF2E 0E94B760 9031F7E7
45A2E263 391C30F6 8865C208 AFB97CCA A9BDE6D1 6050200E 9BFCCEF6
Next, compare the hash value to the contents of the SHA512 file:
After matching the SHA512 hashes, extract the downloaded file with the following command:
tar xzf solr-8.10.0.tgz
Step 4 – Install Apache Solr
Next, run the following command to install Apache Solr to your system:
Once the installation is complete, you should get the following output:
Solr process 9970 running on port 8983
"version":"8.10.0 05c8a6f0163fe4c330e93775e8e91f3ab66a3f80 - mayyasharipova - 2021-06-10 17:54:40",
"uptime":"0 days, 0 hours, 0 minutes, 22 seconds",
"memory":"31.8 MB (%6.2) of 512 MB"}
At this point, Apache Solr is running and listens on port 8983. You can check it with the following command:
ss -altnp | grep 8983
LISTEN 0 50 *:8983 *:* users:(("java",pid=9970,fd=153))
Step 5 – Configure Firewall
If a firewalld firewall is installed and running on your server, then you will need to allow port 8983 through firewalld. You can enable it with the following command:
firewall-cmd --add-port=8983/tcp --permanent
Next, reload the firewall using the following command:
Step 6 – Access Apache Solr
Before accessing Apache Solr, create a test collection using the following command:
su - solr -c "/opt/solr/bin/solr create -c testcollection -n data_driven_schema_configs"
Created new core 'testcollection'
Now, open your web browser and access the Apache Solr web interface using the URL http://your-server-ip:8983. You should see the Apache Solr dashboard on the following page:
Congratulations! You have successfully installed Apache Solr on RockyLinux 8. You can now integrate Apache Solr with your application for search functionality. Get started on a dedicated server from Atlantic.Net today!