Apache Solr is a powerful open-source search platform built on Apache Lucene. It offers a wide range of features, including full-text search, hit highlighting, faceted search, real-time indexing, and rich document-handling capabilities. With its popularity among enterprise search and analytics use cases, installing the latest version of Apache Solr on your Fedora 39 system ensures that you have access to the newest features and security updates. In this guide, we will walk you through the step-by-step process of installing Apache Solr on Fedora 39.

Step 1: Updating your Fedora 39 System

Before installing Apache Solr, it is essential to ensure that your Fedora 39 system is up-to-date and has all the necessary prerequisites. To update your system packages to the latest versions, open the terminal and execute the following commands:

sudo dnf clean all
sudo dnf update

This will update your system with the latest package versions and ensure a smooth installation process.

Step 2: Installing Java

Apache Solr requires Java Runtime Environment (JRE) version 11 or higher. To check if Java is already installed or to verify its version, execute the following command in the terminal:

java-version

If Java is not installed or the version is outdated, you can install or update it using the dnf package manager:

sudo dnf install java-11-openjdk

Additionally, the lsof command is essential for Solr’s installation process. Install it by running the following command:

sudo dnf install lsof

Step 3: Downloading and Installing Apache Solr

Now it’s time to download and install Apache Solr on your Fedora 39 system. Follow these steps:

  1. Navigate to the official Apache Solr download page to identify the latest release version: Apache Solr Download Page
  2. Use the wget command to download the Solr distribution archive. Replace the version number in the URL with the latest version available:
wget https://archive.apache.org/dist/lucene/solr/9.5.0/solr-9.5.0.tgz
  1. Once the download is complete, extract the package and run the installation script:
tar xzf solr-9.5.0.tgz solr-9.5.0/bin/install_solr_service.sh --strip-components=2
sudo bash ./install_solr_service.sh solr-9.5.0.tgz

The installation script will take care of setting up Solr as a service, ensuring it starts automatically on system boot. You can check the status of the Solr service with the following command:

sudo systemctl status solr

Step 4: Configuring Apache Solr

Configuring Apache Solr is crucial for optimal performance. This step involves adjusting the Java heap size, setting up garbage collection parameters, and optimizing index caching. Let’s explore each aspect:

Adjusting Java Heap Size

For a production environment, it is recommended to set a Java heap size of at least 16 GB. You can configure this in the Solr configuration file, typically located at /etc/default/solr.in.sh or /etc/default/solr.in.cmd for Windows users.

Garbage Collection Optimization

Garbage collection (GC) settings can significantly impact Solr’s performance. Enable GC logging and monitor the logs to identify any potential issues. Adjust the GC settings based on your specific workload and environment.

Index Caching

Index caching plays a vital role in improving search performance, especially when dealing with large datasets. Solr provides various cache types that can be configured to enhance performance, such as the filter cache, query result cache, and document cache.

Step 5: Starting and Enabling Solr Service

Once Solr is installed and configured, you can start the Solr service and enable it to start on boot. Execute the following commands in the terminal:

sudo systemctl start solr
sudo systemctl enable solr

To check the status of the Solr service, use the following command:

sudo systemctl status solr

Step 6: Configuring the Firewall

By default, the Solr service listens on port 8983. To allow traffic on this port, you need to configure the firewall. Run the following commands in the terminal:

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

Step 7: Accessing the Apache Solr Web Interface

Congratulations! You have successfully installed Apache Solr on your Fedora 39 system. Now, you can access the Solr web interface by opening your web browser and navigating to http://<your_server_ip>:8983/solr. Replace <your_server_ip> with the IP address of your Fedora 39 server.

Shape.host offers reliable and scalable Cloud VPS services that can be tailored to meet your specific hosting requirements. With their expertise in cloud hosting solutions, Shape.host ensures the highest level of performance, security, and support for your business. Discover the benefits of Shape.host’s Cloud VPS services and take your online presence to new heights.