Apache Solr is an open-source search platform written on Java. Solr provides full-text search, spell suggestions, custom document ordering and ranking, Snippet generation, and highlighting.

This tutorial will help you to install Apache Solr 9.0 on Fedora 36/35/34/33/32 Linux systems.

Step 1 – Prerequsities

Apache Solr 9.0 required the Java Runtime Environment (JRE) version 11 or higher. If the system doesn’t have JRE installed, use the following command to install OpenJDK 17 on the Fedora system.

sudo dnf install java-17-openjdk 

You can check the installed Java version at the command line using:

java -version

openjdk 17.0.3 2022-04-19
OpenJDK Runtime Environment 21.9 (build 17.0.3 7)
OpenJDK 64-Bit Server VM 21.9 (build 17.0.3 7, mixed mode, sharing)

Step 2 – Install Apache Solr on Fedora

Now download the required Solr version from its official site or mirrors. You may also use the below command to download Apache Solr 9.0 from its official website. After that extract the installer script.

wget https://dlcdn.apache.org/solr/solr/9.0.0/solr-9.0.0.tgz 
tar xzf solr-9.0.0.tgz solr-9.0.0/bin/install_solr_service.sh --strip-components=2 

Then execute the installer script with bash shell followed with downloaded Archive file. The command will be like below:

sudo bash ./install_solr_service.sh solr-9.0.0.tgz 

This will create a user with the name solr in your system and finish the installation process. After that start the service default Solr port 8983.

Step 3 – Managing Apache Solr Service

Use the following commands to Start, Stop and check the status of the Solr service.

  • Start Solr service:
    sudo service solr start 
    
  • Stop Solr service:
    sudo service solr stop  
    
  • Restart Solr service:
    sudo service solr restart  
    
  • Check the Solr service status:
    sudo service solr status  
    

    Output

    Found 1 Solr nodes: Solr process 30891 running on port 8983 { "solr_home":"https://tecadmin.net/var/solr/data", "version":"9.0.0 a4eb7aa123dc53f8dac74d80b66a490f2d6b4a26 - janhoy - 2022-05-05 01:00:08", "startTime":"2022-05-26T07:52:42.644Z", "uptime":"0 days, 0 hours, 0 minutes, 14 seconds", "memory":"61.4 MB () of 512 MB"}

Step 4 – Create a New Solr Collection

Apache Solr stores values under a collection. A collection is a single logical index that uses a separate solrconfig.xml configuration file with a single index schema.

You can create a new collection using the Apache Solr command-line utility or using Solr APIs. The below command will create a new collection in Solr named mycol1.

sudo su - solr -c "https://tecadmin.net/opt/solr/bin/solr create -c mycol1 -n data_driven_schema_configs" 

Output:

Created new core 'mycol1'

Step 5 – Allow Solr Access on Public Network

The default Apache Solr runs on localhost only. To allow the Solr server publically accessible over networks, edit the /etc/default/solr.in.sh configuration file.

sudo vim /etc/default/solr.in.sh 

Search for the SOLR_JETTY_HOST variable. Uncomment it by removing the starting hash (#) symbol. Set the value to “0.0.0.0”.

How To Install Apache Solr 9.0 on Fedora 36/35 Apache Fedora Indexing nosql Solr
Enable Apache Solr to Listen on Public Network



Save the configuration file and restart Solr service:

sudo service solr restart  

You also need to open the port in the system firewall. The below-mentioned command will open port 8983 in firewalld.

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

Step 6 – Access Solr Web Admin Panel

The default Apache Solr runs on port 8983. You can access the Solr port in your web browser and you will get the Solr dashboard.

I already have mapped the domain solr.tecadmin.net with the Fedora server IP address.

  http://solr.tecadmin.net:8983/
How To Install Apache Solr 9.0 on Fedora 36/35 Apache Fedora Indexing nosql Solr
Apache Solr Dashboard

Here you can view statics of created collection in previous steps named “mycol1”. Click on “Core Selector” on the left sidebar and select created collection.

How To Install Apache Solr 9.0 on Fedora 36/35 Apache Fedora Indexing nosql Solr
Apache Solr Collection Details

Conclusion

This tutorial helped you to install Apache Solr on the Fedora Linux system.