Atlantic.Net Blog

How to Install Apache Solr on Oracle Linux 8

Apache Solr is an open-source, REST API-based search platform built on Apache Lucene Framework. It is also called “Searching On Lucene w/Replication.” Written in Java Language, Apache Solr is designed for scalability and fault tolerance. Solr is enterprise-ready, fast, and highly scalable, making it ideal for use in search-based and big data analytics applications. In simple terms, Solr is a ready-to-deploy search engine that is optimized to search large volumes of text-centric data.

In this post, we will show you how to install Apache Solr on Oracle Linux 8.

Step 1 – 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 update -y
dnf install java-11-openjdk -y

Once installed, you can verify the Java version using the following command:

java --version

You should get the following output:

openjdk 11.0.15 2022-04-19 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.15+9-LTS)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.15+9-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

Also Read

How to Install and Manage Java Versions on Oracle Linux 8

Step 2 – Download Apache Solr

By default, Apache Solr is not included in the Oracle Linux default repository, so you will need to download it from their official website.

You can download it with the following command:

wget https://dlcdn.apache.org/lucene/solr/8.11.1/solr-8.11.1.tgz

Once Apache Solr is downloaded, download the SHA512 checksum using the following command:

wget https://downloads.apache.org/lucene/solr/8.11.1/solr-8.11.1.tgz.sha512

Next, calculate the SHA512 checksum of the Apache Solr downloaded file:

gpg --print-md SHA512 solr-8.11.1.tgz

Sample output:

solr-8.11.1.tgz: 4893F836 AEC84B03 D7BFE574 E59E305C 03B5EDE4 A4802003 4FBE8144
                 0B8FEEE7 9E55FD9E AD230E5B 89B3F251 24E9B56C 1DDC4BB5 C7F631CF
                 4E846B9C AB5F9A45

Next, compare the hash value to the contents of the SHA512 file:

cat solr-8.11.1.tgz.sha512

Sample output:

4893f836aec84b03d7bfe574e59e305c03b5ede4a48020034fbe81440b8feee79e55fd9ead230e5b89b3f25124e9b56c1ddc4bb5c7f631cf4e846b9cab5f9a45 *solr-8.11.1.tgz

After matching the SHA512 hashes, extract the downloaded file with the following command:

tar xzf solr-8.11.1.tgz

Step 3 – Install Apache Solr

At this point, Apache Solr is downloaded and ready for installation. You can install it using the following command:

solr-8.11.1/bin/install_solr_service.sh solr-8.11.1.tgz

Once the installation is complete, you should get the following output:

Solr process 4739 running on port 8983
{
  "solr_home":"/var/solr/data",
  "version":"8.11.1 0b002b11819df70783e83ef36b42ed1223c14b50 - janhoy - 2021-12-14 13:50:55",
  "startTime":"2022-04-30T12:07:29.806Z",
  "uptime":"0 days, 0 hours, 0 minutes, 13 seconds",
  "memory":"91.9 MB (%17.9) of 512 MB"}

At this point, Apache Solr is started and listens on port 8983. You can check it with the following command:

ss -altnp | grep 8983

Sample output:

LISTEN 0      50                      *:8983             *:*    users:(("java",pid=4739,fd=157))

Step 4 – Configure Firewall

If the firewalld firewall is installed and running in your server, then you will need to allow port 8983 through firewalld. You can allow it with the following command:

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

Next, reload the firewall using the following command:

firewall-cmd --reload

Also Read

How to Setup Firewall with Firewalld

Step 5 – Access Apache Solr

You can 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:

Apache Solr dashboard page

Conclusion

Congratulations! You have successfully installed Apache Solr on Oracle Linux 8. You can now start building a search-based big analytics application using the Apache Solr. Give it a try on your virtual private server from Atlantic.Net!

Get a $250 Credit and Access to Our Free Tier!

Free Tier includes:
G3.2GB Cloud VPS a Free to Use for One Year
50 GB of Block Storage Free to Use for One Year
50 GB of Snapshots Free to Use for One Year