Install Apache Solr on Rocky Linux 9

This tutorial intends to teach you to Install Apache Solr on Rocky Linux 9. Apache Solr is a search engine under Apache Lucene. It is a NoSQL database with transactional support.

You can follow this guide to start your Apache Solr in the latest version on Rocky Linux 9.

How To Install Apache Solr on Rocky Linux 9?

Before you start your Apache Solr installation, you need to log in to your server as a non-root user with sudo privileges and set up a basic firewall. To do this, you can follow our article the Initial Server Setup with Rocky Linux 9.

Then, proceed to the following steps to complete this guide.

Step 1 – Install Java on Rocky Linux 9

To install Apache Solr, you need to have Java installed on your server. First, run the system update by using the command below:

sudo dnf update -y

Then, you need to install the Epel release on Rocky Linux 9 with the command below:

sudo dnf install epel-release -y

Now you can use the following command to install the latest OpenJDK on your server:

sudo dnf install java-latest-openjdk -y

When your installation is completed, verify your installation by checking its version:

java -version

In your output you will see:

Output
openjdk version "20.0.1" 2023-04-18
OpenJDK Runtime Environment (Red_Hat-20.0.1.0.9-4.rolling.el9) (build 20.0.1+9)
OpenJDK 64-Bit Server VM (Red_Hat-20.0.1.0.9-4.rolling.el9) (build 20.0.1+9, mixed mode, sharing)

Step 2 – Download and Run Apache Solr on Rocky Linux 9

At this point, you need to visit the Apache Solr Downloads page to check the latest version available of Solr.

At the time of writing this article, the latest version of Solr was 9.3.0.

Now use the wget command to download the Apache Solr on Rocky Linux 9:

sudo wget https://dlcdn.apache.org/solr/solr/9.3.0/solr-9.3.0.tgz

Then, you need to extract the Solr downloaded file with the command below:

sudo tar xzf solr-9.3.0.tgz

Note: If the tar command is not installed on your server, use the following command to install it:

sudo dnf install tar -y

Here you can Install Apache Solr on your server with the command below:

bash solr-9.3.0/bin/install_solr_service.sh solr-9.3.0.tgz

During the installation, you will see some warnings about file and process limits. To solve these problems, you need to define the security limits as required by the Apache Solr. Open the file with your favorite text editor, here we use the vi editor:

sudo vi /etc/security/limits.conf

Add the following lines at the end of the file:

...
*               soft    nofile		65000
*               hard    nofile		65000
*               soft    nproc		65000
*               hard    nproc		65000

When you are done, save and close the file.

Then, restart Apache Solr on Rocky Linux 9 to apply the changes:

sudo su - solr -c "/opt/solr/bin/solr restart"

Step 3- Configure Firewall for Apache Solr

At this point, we assumed that you have enabled the firewall from the requirements. You need to allow traffic on port 8983 through the firewall. To do this, run the command below:

sudo firewall-cmd --add-port=8983/tcp --permanent

Reload the firewall to apply the new rules with the following command:

sudo firewall-cmd --reload

Step 4 – Access Apache Solr Web Interface

Here you can access the Apache Solr web interface by typing your server’s IP address in your web browser followed by 8983:

http://your-server-ip-address:8983/solr

You will see the Apache Solr dashboard screen:

Solr dashboard

That’s it, you are done.

Conclusion

At this point, you have learned to Install and Configure Apache Solr on Rocky Linux 9 and Access Solr dashboard from the web interface. Hope you enjoy using it. Please subscribe to us on Facebook, Instagram, and Twitter.

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Leave a Reply

Stay informed and not overwhelmed, subscribe now!