Facebook X (Twitter) Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook X (Twitter) Instagram
    TecAdmin
    You are at:Home»Linux Distributions»Fedora»How To Install Apache Solr on Fedora

    How To Install Apache Solr on Fedora

    By RahulMay 12, 20234 Mins Read

    Apache Solr is an open-source search platform built upon a Java library called Lucene. Solr is a popular search platform for web sites because it can index and search multiple sites and return recommendations for related content based on the search query’s taxonomy.

    This guide will walk you through the installation process of Apache Solr on a Fedora system. Please note that the instructions below assume that you have root access to your Fedora system.

    Prerequisites

    Before we begin, you’ll need:

    • A Fedora system
    • Access to a terminal window/command line
    • A user account with sudo or root privileges

    Step 1: Update System Packages

    First, we need to update the system packages to their latest versions. Open your terminal and execute the following command:

    sudo dnf update -y 
    

    Step 2: Install Java

    Since Apache Solr is built on Java, we need to install it first. You can check if Java is already installed by using the command:

    java -version 
    

    If Java is not installed, or the version is lower than 8, install or update it by using the following command:

    sudo dnf install java-11-openjdk-devel 
    

    Verify the installation by checking the Java version again.

    Step 3: Install Apache Solr

    Next, we’ll download and install Apache Solr. As of today in May 2023, the latest version was 9.2.1, but you should replace “9.2.1” in the following commands with the version number of the latest stable release available.

    wget https://dlcdn.apache.org/solr/solr/9.2.1/solr-9.2.1.tgz 
    

    Once the download is completed, extract the Solr files from the downloaded package using the following command:

    tar xzf solr-9.2.1.tgz solr-9.2.1/bin/install_solr_service.sh --strip-components=2 
    

    Now, run the installation script:

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

    This will install Solr as a service on your machine, running on the default port 8983.

    Step 4: Verify Installation

    To make sure that Solr is installed correctly, you can check its status by using the following command:

    sudo systemctl status solr 
    

    If Solr is running correctly, you should see output indicating that the service is active (running).

    You can also access the Solr admin panel by opening a web browser and navigating to http://localhost:8983/solr

    Step 5: Configure Solr (Optional)

    Apache Solr is now installed and running on your Fedora system. Next, you might want to configure Solr for your specific needs. For example, you might want to create a new Solr core:

    sudo su - solr -c "/opt/solr/bin/solr create -c  -n data_driven_schema_configs" 
    

    Replace with the name of your new core.

    Step 6: 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”.

    Installing Solr on Fedora Linux
    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 7: 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/
    
    Installing Apache Solr on Fedora
    Apache Solr Dashboard

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

    Installing Apache Solr on Fedora
    Apache Solr Collection Details

    Conclusion

    Congratulations, you have installed Apache Solr on your Fedora system! From here, you can further configure Solr to fit your needs, or start indexing and searching documents using the Solr API. Be sure to refer to the official Solr documentation for more detailed information about what you can do with Solr.

    Please note that this guide is intended for use on a local development machine. If you’re installing Solr on a production server, there are additional considerations you’ll need to take into account. This might include securing your Solr instances with authentication, setting up an SSL certificate, fine-tuning your server settings for optimal performance, and setting up a proper backup strategy.

    Apache fedora Indexing nosql Solr
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    How to Enable Server Side Include (SSI) in Apache

    How To Enable Server Side Includes (SSI) in Apache

    How to Enable Caching in Apache

    Installing Tomcat 10

    How to Install and Configure Tomcat 10 on Ubuntu 22.04

    View 11 Comments

    11 Comments

    1. Ali on February 25, 2020 7:40 pm

      We recommend installing the ‘lsof’ command for more stable start/stop of Solr
      id: solr: no such user
      Creating new user: solr

      Extracting solr-8.4.1.tgz to /opt

      Installing symlink /opt/solr -> /opt/solr-8.4.1 …

      Installing /etc/init.d/solr script …

      Installing /etc/default/solr.in.sh …

      Service solr installed.
      Customize Solr startup configuration in /etc/default/solr.in.sh
      su: Permission denied
      su: Permission denied

      Reply
    2. David on April 9, 2019 9:29 pm

      Where do I need to download it before install ? opt or local? Do I have to command with root account ?
      Thanks

      Reply
      • Rahul on April 10, 2019 4:42 am

        Download it under /tmp directory.

        Reply
    3. Robert on July 7, 2018 6:25 pm

      Here small update for Centos 7.5 + Solr 7.4

      Install Java
      sudo yum install java-1.8.0-openjdk

      Install Solr
      cd /usr/local
      wget http://apache.lauf-forum.at/lucene/solr/7.4.0/solr-7.4.0.tgz
      tar xzf solr-7.4.0.tgz solr-7.4.0/bin/install_solr_service.sh –strip-components=2
      sudo bash ./install_solr_service.sh solr-7.4.0.tgz

      Core creation
      sudo su – solr -c “/opt/solr/bin/solr create -c NAMEOFCORE -n data_driven_schema_configs”

      Reply
    4. Ori Atias on December 20, 2017 12:29 pm

      Thanks Rahul, In my installation I got stuck in step 4 of this manual.
      after running: sudo su – solr -c “/usrlocal/solr/bin/solr create -c mycol1 -n data_driven_schema_configs”.
      i get error : /usrlocal/solr/bin/solr: No such file or directory
      which is true – this path does not exist.
      I tried /usr/local/… thinking that you had a typo but didnt work…
      I also tried creating those directories that didnt help.
      By now you probably understand that i don’t have much experience with linux 🙂
      can you please explain what am i doing wrong?

      Reply
      • Rahul K. on December 20, 2017 12:43 pm

        Thanks Atias, I have fixed typo in command. What error are you getting with the correct path command?

        Reply
      • Anand on January 10, 2018 4:58 pm

        Hi,

        # sudo su – solr -c “/opt/solr/bin/solr create -c gettingstarted -n data_driven_schema_configs”

        ERROR: Failed to create new core instance directory: /opt/solr/server/solr/gettingstarted

        I get the above error while create a core. How do I fix this?

        Reply
        • reggie on January 23, 2019 7:21 pm

          sol[r]= S%#t Outta luck [redo]

          Reply
        • Manveer Singh on March 31, 2021 9:35 am

          Same Error i have

          WARNING: Using _default configset with data driven schema functionality. NOT RECOMMENDED for production use.
          To turn off: bin/solr config -c bck43 -p 8983 -action set-user-property -property update.autoCreateFields -value false

          ERROR: Failed to create new core instance directory: /opt/solr-8.4.1/server/solr/bck43

          Reply
    5. Santosh on December 13, 2017 11:47 am

      Thank you so much Rahul. You saved me buddy.

      Reply
    6. Ammy on December 2, 2017 2:45 pm

      Thanks TecAdmin, I have successfully installed Solr … How do I insert data to collection?

      Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Difference Between Full Virtualization vs Paravirtualization
    • Virtualization vs. Containerization: A Comparative Analysis
    • Using .env Files in Django
    • Using .env File in FastAPI
    • Setting Up Email Notifications for Django Error Reporting
    Facebook X (Twitter) Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.