{"id":4788,"date":"2018-11-19T20:42:45","date_gmt":"2018-11-19T17:42:45","guid":{"rendered":"https:\/\/computingforgeeks.com\/?p=4788"},"modified":"2023-12-29T01:52:07","modified_gmt":"2023-12-28T22:52:07","slug":"install-apache-solr-on-centos-fedora","status":"publish","type":"post","link":"https:\/\/computingforgeeks.com\/install-apache-solr-on-centos-fedora\/","title":{"rendered":"Install Apache Solr on CentOS \/ Fedora \/ Rocky Linux"},"content":{"rendered":"\n<p>Apache Solr is an open source, fault-tolerant and highly scalable search tool written in Java. Apache Solr powers the search and navigation features of many of the world\u2019s largest internet sites. In this tutorial, we will look at how to&nbsp; Install Apache Solr on CentOS \/ Fedora \/ Rocky Linux system.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1: Install Java on CentOS \/ Fedora \/ Rocky<\/h2>\n\n\n\n<p>Apache Solr requires Java. If you don&#8217;t have Java installed on your system, install it as shown below.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo yum install lsof java-11-openjdk  java-11-openjdk-devel -y<\/code><\/pre>\n\n\n\n<p>After the installation of Java, you can quickly confirm the version using the following command: <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-pale-pink-color\"> java -version<\/mark>\nopenjdk version \"11.0.16.1\" 2022-08-12 LTS\nOpenJDK Runtime Environment (Red_Hat-11.0.16.1.1-1.el7_9) (build 11.0.16.1+1-LTS)\nOpenJDK 64-Bit Server VM (Red_Hat-11.0.16.1.1-1.el7_9) (build 11.0.16.1+1-LTS, mixed mode, sharing)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2: Install Apache Solr on CentOS \/ Fedora<\/h2>\n\n\n\n<p>Apache Solr is not available on CentOS &amp; Fedora upstream repositories, you have to download it and do a manual installation. You can check the latest<a href=\"https:\/\/solr.apache.org\/downloads.html\" target=\"_blank\" rel=\"noreferrer noopener\">&nbsp;release of Apache Solr<\/a>&nbsp;then&nbsp;save it to the&nbsp;<code>LATEST_VER<\/code> variable. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd ~\/\nexport LATEST_VER=\"9.4.0\"\ncurl -O https:\/\/dlcdn.apache.org\/solr\/solr\/$LATEST_VER\/solr-$LATEST_VER.tgz<\/code><\/pre>\n\n\n\n<p>Extract the archive downloaded:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tar xvf solr-${LATEST_VER}.tgz<\/code><\/pre>\n\n\n\n<p>Now run the Apache Solr service installer script to setup Solr environment.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd solr-${LATEST_VER}\/bin\/\nsudo .\/install_solr_service.sh ~\/solr-${LATEST_VER}.tgz<\/code><\/pre>\n\n\n\n<p>Sample output: <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>id: solr: no such user\nCreating new user: solr\n\nExtracting \/root\/solr-9.0.4.tgz to \/opt\n\nInstalling symlink \/opt\/solr -> \/opt\/solr-9.0.4 ...\n\nInstalling \/etc\/init.d\/solr script ...\n\nInstalling \/etc\/default\/solr.in.sh ...\n\nService solr installed.\nCustomize Solr startup configuration in \/etc\/default\/solr.in.sh\n*** &#91;WARN] *** Your open file limit is currently 1024.\n It should be set to 65000 to avoid operational disruption.\n If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh\n*** &#91;WARN] ***  Your Max Processes Limit is currently 4096.\n It should be set to 65000 to avoid operational disruption.\n If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh\n\/opt\/solr\/bin\/solr: line 2263: \/opt\/solr\/bin\/solr-8983.pid: Permission denied\nWaiting up to 180 seconds to see Solr running on port 8983 &#91;\/]\nStarted Solr server on port 8983 (pid=1754). Happy searching!\n\n\nFound 1 Solr nodes:\n\nSolr process 1754 running on port 8983\n{\n  \"solr_home\":\"\/var\/solr\/data\",\n  \"version\":\"9.0.0 a4eb7aa123dc53f8dac74d80b66a490f2d6b4a26 - janhoy - 2022-05-05 01:00:08\",\n  \"startTime\":\"2022-10-17T16:56:40.472Z\",\n  \"uptime\":\"0 days, 0 hours, 0 minutes, 19 seconds\",\n  \"memory\":\"91.5 MB (%17.9) of 512 MB\"}<\/code><\/pre>\n\n\n\n<p>Checking service status using SysV Init:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-pale-pink-color\">service solr status<\/mark>\nFound 1 Solr nodes:\n\nSolr process 1221 running on port 8983\n\n{\n  \"solr_home\":\"\/var\/solr\/data\",\n  \"version\":\"9.0.4 a4eb7aa123dc53f8dac74d80b66a490f2d6b4a26 - janhoy - 2022-05-05 01:00:08\",\n  \"startTime\":\"2022-10-17T16:58:59.283Z\",\n  \"uptime\":\"0 days, 0 hours, 11 minutes, 19 seconds\",\n  \"memory\":\"73.2 MB (%14.3) of 512 MB\"}<\/code><\/pre>\n\n\n\n<p>Systemd way:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-pale-pink-color\"> systemctl status solr<\/mark>\n\u25cf solr.service - LSB: Controls Apache Solr as a Service\n   Loaded: loaded (\/etc\/rc.d\/init.d\/solr; bad; vendor preset: disabled)\n   Active: active (exited) since Mon 2022-10-17 17:15:50 UTC; 4min 1s ago\n     Docs: man:systemd-sysv-generator(8)\n  Process: 1051 ExecStart=\/etc\/rc.d\/init.d\/solr start (code=exited, status=0\/SUCCESS)\n\nOct 17 17:15:33 cent7.mylab.io solr&#91;1051]: *** &#91;WARN] ***  Your Max Processes Limit is currently 4096.\nOct 17 17:15:33 cent7.mylab.io solr&#91;1051]: It should be set to 65000 to avoid operational disruption.\nOct 17 17:15:33 cent7.mylab.io solr&#91;1051]: If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh\nOct 17 17:15:33 cent7.mylab.io solr&#91;1051]: \/opt\/solr\/bin\/solr: line 2263: \/opt\/solr\/bin\/solr-8983.pid: Permission denied\nOct 17 17:15:33 cent7.mylab.io solr&#91;1051]: Warning: Available entropy is low. As a result, use of the UUIDField, SSL, or any other features that require\nOct 17 17:15:33 cent7.mylab.io solr&#91;1051]: RNG might not work properly. To check for the amount of available entropy, use 'cat \/proc\/sys\/kernel\/random\/entropy_avail'.\nOct 17 17:15:50 cent7.mylab.io solr&#91;1051]: &#91;386B blob data]\nOct 17 17:15:50 cent7.mylab.io solr&#91;1051]: Started Solr server on port 8983 (pid=1219). Happy searching!\nOct 17 17:15:50 cent7.mylab.io systemd&#91;1]: Started LSB: Controls Apache Solr as a Service.\nOct 17 17:15:50 cent7.mylab.io solr&#91;1051]: &#91;14B blob data]<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3: Access Solr Dashboard<\/h2>\n\n\n\n<p>By default Solr runs on port&nbsp;<code>8983<\/code>. If you have an active firewall, allow port&nbsp;8983.\n<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo firewall-cmd  --permanent --add-port=8983\/tcp<br>sudo firewall-cmd --reload<\/code><\/pre>\n\n\n\n<p>The dashboard should be accessible on the Server IP Address \/ Hostname and port <code>8983<\/code>.\n<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>http:&#47;&#47;&lt;IP|Hostname&gt;:8983<\/code><\/pre>\n\n\n\n<p>You should get a dashboard similar to one below:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a class=\"td-modal-image\" href=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2018\/11\/install-apache-solr-ubuntu-18.04-debian-9-02.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"412\" src=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2018\/11\/install-apache-solr-ubuntu-18.04-debian-9-02-1024x412.png\" alt=\"\" class=\"wp-image-4782\" title=\"\" srcset=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2018\/11\/install-apache-solr-ubuntu-18.04-debian-9-02-1024x412.png 1024w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2018\/11\/install-apache-solr-ubuntu-18.04-debian-9-02-300x121.png 300w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2018\/11\/install-apache-solr-ubuntu-18.04-debian-9-02-768x309.png 768w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2018\/11\/install-apache-solr-ubuntu-18.04-debian-9-02-696x280.png 696w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2018\/11\/install-apache-solr-ubuntu-18.04-debian-9-02-1068x430.png 1068w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2018\/11\/install-apache-solr-ubuntu-18.04-debian-9-02-1044x420.png 1044w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Step 4: Create Solr Collection<\/h2>\n\n\n\n<p>You can now create your first Solr collection:\n<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo su - solr -c \"\/opt\/solr\/bin\/solr create -c testcollection -n data_driven_schema_configs\"<\/code><\/pre>\n\n\n\n<p>Where <code>testcollection<\/code> is the name of the collection to be created.<\/p>\n\n\n\n<p>Sample output:\n<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>INFO - 2018-11-18 13:48:05.538; org.apache.solr.util.configuration.SSLCredentialProviderFactory; Processing SSL Credential Provider chain: env;sysprop<br>Created new core 'testcollection'<\/code><\/pre>\n\n\n\n<p>The created collections are available&nbsp;on the dashboard from the Collections left panel.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2018\/11\/install-apache-solr-centos-7-fedora-29-28-01.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"476\" src=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2018\/11\/install-apache-solr-centos-7-fedora-29-28-01-1024x476.png\" alt=\"\" class=\"wp-image-4789\" title=\"\" srcset=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2018\/11\/install-apache-solr-centos-7-fedora-29-28-01-1024x476.png 1024w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2018\/11\/install-apache-solr-centos-7-fedora-29-28-01-300x139.png 300w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2018\/11\/install-apache-solr-centos-7-fedora-29-28-01-768x357.png 768w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2018\/11\/install-apache-solr-centos-7-fedora-29-28-01-696x324.png 696w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2018\/11\/install-apache-solr-centos-7-fedora-29-28-01-1068x496.png 1068w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2018\/11\/install-apache-solr-centos-7-fedora-29-28-01-903x420.png 903w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p>Beginning with Solr 4.4, a&nbsp;<a href=\"https:\/\/lucene.apache.org\/solr\/resources.html#documentation\" target=\"_blank\" rel=\"noopener noreferrer\">detailed reference guide<\/a>&nbsp;is available online or as a PDF download.<\/p>\n\n\n\n<p>For Ubuntu \/ Debian refer to<a href=\"https:\/\/computingforgeeks.com\/install-latest-apache-solr-on-ubuntu-debian\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" Install Latest Apache Solr on Ubuntu\/Debian (opens in a new tab)\"> Install Latest Apache Solr on Ubuntu\/Debian<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Apache Solr is an open source, fault-tolerant and highly scalable search tool written in Java. Apache Solr powers the search and navigation features of many of the world\u2019s largest internet sites. In this tutorial, we will look at how to&nbsp; Install Apache Solr on CentOS \/ Fedora \/ Rocky Linux system. Step 1: Install Java &#8230; <a title=\"Install Apache Solr on CentOS \/ Fedora \/ Rocky Linux\" class=\"read-more\" href=\"https:\/\/computingforgeeks.com\/install-apache-solr-on-centos-fedora\/\" aria-label=\"Read more about Install Apache Solr on CentOS \/ Fedora \/ Rocky Linux\">Read more<\/a><\/p>\n","protected":false},"author":3,"featured_media":4794,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[299,17,29,50],"tags":[241,725],"class_list":["post-4788","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-how-to","category-centos","category-fedora","category-linux-tutorials","tag-apache","tag-solr"],"_links":{"self":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts\/4788","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/comments?post=4788"}],"version-history":[{"count":0,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts\/4788\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/media\/4794"}],"wp:attachment":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/media?parent=4788"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/categories?post=4788"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/tags?post=4788"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}