Atlantic.Net Blog

How to Install Apache Solr on Rocky Linux 8

Hitesh Jethva
by Atlantic.Net (345 posts) under Dedicated Server Hosting, Tutorials
0 Comments

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.

Prerequisites

  • 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:

java --version

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:

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

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:

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

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

gpg --print-md SHA512 solr-8.10.0-src.tgz.sha512

Sample output:

solr-8.9.0.tgz: 15150B7F 191FD9E8 D2C1BD8B B619DD4B 3F27AF2E 0E94B760 9031F7E7
                45A2E263 391C30F6 8865C208 AFB97CCA A9BDE6D1 6050200E 9BFCCEF6
                5F762C2E D743C242

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

cat 8.10.0-src.tgz.sha512

Sample output:

15150b7f191fd9e8d2c1bd8bb619dd4b3f27af2e0e94b7609031f7e745a2e263391c30f68865c208afb97ccaa9bde6d16050200e9bfccef65f762c2ed743c242 *solr-8.9.0.tgz

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:

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

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

Solr process 9970 running on port 8983
{
  "solr_home":"/var/solr/data",
  "version":"8.10.0 05c8a6f0163fe4c330e93775e8e91f3ab66a3f80 - mayyasharipova - 2021-06-10 17:54:40",
  "startTime":"2021-09-22T07:59:47.274Z",
  "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

Sample output:

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:

firewall-cmd --reload

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"

Sample output:

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:
Apache Solr Dashboard

Conclusion

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!

Get A Free To Use Cloud VPS

Free Tier Includes:
G3.2GB Cloud VPS 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


Looking for a Hosting Solution?

We Provide Cloud, Dedicated, & Colocation.

  • Seven Global Data Center Locations.
  • Flexible Private, Public, & Hybrid Hosting.
  • 24x7x365 Security, Support, & Monitoring.
Contact Us Now! Med Tech Award FTC
SOC Audit HIPAA Audit HITECH Audit

Recent Posts

How to Install Python 3.10 on Rocky Linux 8
How to Install TaskBoard on Rocky Linux 8
How to Set Up Pritunl VPN Server on Rocky Linux 8
How to Install Teampass Password Manager on Rocky Linux 8
How to Install and Configure RabbitMQ Server on Rocky Linux 8

Get started with 12 months of free cloud VPS hosting

Free Tier includes:
G3.2GB Cloud VPS Server 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


New York, NY

100 Delawanna Ave, Suite 1

Clifton, NJ 07014

United States

San Francisco, CA

2820 Northwestern Pkwy,

Santa Clara, CA 95051

United States

Dallas, TX

2323 Bryan Street,

Dallas, Texas 75201

United States

Ashburn, VA

1807 Michael Faraday Ct,

Reston, VA 20190

United States

Orlando, FL

440 W Kennedy Blvd, Suite 3

Orlando, FL 32810

United States

Toronto, Canada

20 Pullman Ct, Scarborough,

Ontario M1X 1E4

Canada

London, UK

14 Liverpool Road, Slough,

Berkshire SL1 4QZ

United Kingdom

Resources