Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Linux Distributions»Fedora»How To Install Apache Solr 9.0 on Fedora 36/35

    How To Install Apache Solr 9.0 on Fedora 36/35

    By RahulMay 26, 20223 Mins Read

    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.

    Advertisement

    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":"/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 (%12) 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 "/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”.

    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 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/
    
    Installing Apache Solr on Fedora
    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.

    Installing Apache Solr on Fedora
    Apache Solr Collection Details

    Conclusion

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

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

    Related Posts

    How to Install and Secure MongoDB on Ubuntu 22.04

    Comparing Apache MPM Worker and Prefork: Which is Right for Your Application

    How to Install Apache (httpd) on RHEL & CentOS Stream 9

    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
    • Implementing a Linux Server Security Audit: Best Practices and Tools
    • cp Command in Linux (Copy Files Like a Pro)
    • 15 Practical Examples of dd Command in Linux
    • dd Command in Linux (Syntax, Options and Use Cases)
    • Iptables: Common Firewall Rules and Commands
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

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