{"id":7262,"date":"2020-11-19T20:29:31","date_gmt":"2020-11-19T17:29:31","guid":{"rendered":"https:\/\/kifarunix.com\/?p=7262"},"modified":"2024-03-14T23:45:01","modified_gmt":"2024-03-14T20:45:01","slug":"install-latest-apache-solr-on-centos-8","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-latest-apache-solr-on-centos-8\/","title":{"rendered":"Install latest Apache Solr on CentOS 8"},"content":{"rendered":"\n<p>Welcome to our tutorial on how to install latest Apache Solr on CentOS 8. <a rel=\"noreferrer noopener\" href=\"https:\/\/lucene.apache.org\/solr\/\" target=\"_blank\">Apache Solr<\/a><em>&nbsp;is the popular, blazing-fast, open source enterprise search platform built on Apache Lucene. It is highly reliable, scalable and fault tolerant, providing distributed indexing, replication and load-balanced querying, automated failover and recovery, centralized configuration and more. Solr powers the search and navigation features of many of the world\u2019s largest internet sites<\/em>.&nbsp;<em>With Solr, you put documents in it (called \u201cindexing\u201d) via JSON, XML, CSV or binary over HTTP. You query it via HTTP GET and receive JSON, XML, CSV or binary results<\/em>.<\/p>\n\n\n\n<p>Solr Features as outlined on&nbsp;<a href=\"https:\/\/lucene.apache.org\/solr\/features.html\" target=\"_blank\" rel=\"noreferrer noopener\">Apache Solr Features page<\/a>.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Advanced Full-Text Search Capabilities<\/li>\n\n\n\n<li>Optimized for High Volume Traffic<\/li>\n\n\n\n<li>Standards Based Open Interfaces \u2013 XML, JSON and HTTP<\/li>\n\n\n\n<li>Comprehensive Administration Interfaces<\/li>\n\n\n\n<li>Easy Monitoring<\/li>\n\n\n\n<li>Highly Scalable and Fault Tolerant<\/li>\n\n\n\n<li>Flexible and Adaptable with easy configuration<\/li>\n\n\n\n<li>Near Real-Time Indexing<\/li>\n\n\n\n<li>Extensible Plugin Architecture<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Installing Apache Solr on CentOS 8<\/h2>\n\n\n\n<p>Follow through this guide to learn how to install Apache Solr on CentOS 8.<\/p>\n\n\n\n<p>Update your system packages;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>dnf update<\/code><\/pre>\n\n\n\n<p>Install other tools that are required;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>dnf install curl wget tar lsof<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"install-java-jre-ubuntu-20.04\">Install Java Runtime Environment (JRE) on CentOS 8<\/h3>\n\n\n\n<p>JRE is one of the requirements for installing latest Apache Solr on CentOS 8. JRE version 1.8 or higher. Hence, run the command below to install the latest JRE on CentOS 8;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>dnf install epel-release<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>dnf install java-latest-openjdk<\/code><\/pre>\n\n\n\n<p>You can verify the version of installed JRE by executing the command below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>java --version<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>openjdk version \"15\" 2020-09-15\nOpenJDK Runtime Environment 20.9 (build 15+36)\nOpenJDK 64-Bit Server VM 20.9 (build 15+36, mixed mode, sharing)<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Install Apache Solr<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">Download latest Apache Solr release version<\/h4>\n\n\n\n<p>Solr 8.7.0 is the most recent Apache Solr release. Hence, navigate their&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/lucene.apache.org\/solr\/downloads.html\" target=\"_blank\">downloads page<\/a>&nbsp;and grab the latest release archive. You can simply obtain the download url and use wget to pull it down.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>dnf install wget -y<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>wget https:\/\/downloads.apache.org\/lucene\/solr\/8.7.0\/solr-8.7.0.tgz<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Verify Integrity of Apache Solr Archive<\/h4>\n\n\n\n<p>Once you have downloaded the archive, you need to verify its integrity. The downloaded archive can be verified using the PGP or SHA checksum. We use the later in this guide. Therefore, download the SHA512 checksum of the same version of the Apache Solr release you downloaded from the download page.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>wget https:\/\/downloads.apache.org\/lucene\/solr\/8.7.0\/solr-8.7.0.tgz.sha512<\/code><\/pre>\n\n\n\n<p>Once the download is done, calculate the SHA512 checksum of the Apache Solr archive downloaded;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>gpg --print-md SHA512 solr-8.7.0.tgz<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>gpg: directory '\/root\/.gnupg' created\ngpg: keybox '\/root\/.gnupg\/pubring.kbx' created\nsolr-8.7.0.tgz: 15A3AF83 997E2CBC 4BFED304 F7D43EFD 260674D9 80592416 05FF3CDE\n                0AE02D8B D1CCD569 73C6CBA1 CC118956 55BB76FC F1991BBB 94B004E5\n                17CE15F7 28FA163F<\/code><\/pre>\n\n\n\n<p>Compare the hash value with the contents of the SHA512 file downloaded.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>cat solr-8.7.0.tgz.sha512<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>15a3af83997e2cbc4bfed304f7d43efd260674d98059241605ff3cde0ae02d8bd1ccd56973c6cba1cc11895655bb76fcf1991bbb94b004e517ce15f728fa163f *solr-8.7.0.tgz<\/code><\/pre>\n\n\n\n<p>Ensure that the hashes match.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Extract Apache Solr Archive<\/h4>\n\n\n\n<p>Once you verify the integrity of the downloaded archive, extract it as follows;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>tar xzf solr-8.7.0.tgz<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Install Apache Solr on CentOS 8<\/h4>\n\n\n\n<p>From the current working directory, execute the command below to install Apache Solr ;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>solr-8.7.0\/bin\/install_solr_service.sh solr-8.7.0.tgz<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>id: \u2018solr\u2019: no such user\nCreating new user: solr\n\nExtracting solr-8.7.0.tgz to \/opt\n\n\nInstalling symlink \/opt\/solr -&gt; \/opt\/solr-8.7.0 ...\n\n\nInstalling \/etc\/init.d\/solr script ...\n\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 14980. \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\nNOTE: Please install lsof as this script needs it to determine if Solr is listening on port 8983.\n\nStarted Solr server on port 8983 (pid=3609). Happy searching!\n\n\nFound 1 Solr nodes: \n\nSolr process 3609 running on port 8983\n{\n  \"solr_home\":\"\/var\/solr\/data\",\n  \"version\":\"8.7.0 2dc63e901c60cda27ef3b744bc554f1481b3b067 - atrisharma - 2020-10-29 19:39:16\",\n  \"startTime\":\"2020-11-17T20:04:24.826Z\",\n  \"uptime\":\"0 days, 0 hours, 0 minutes, 17 seconds\",\n  \"memory\":\"56.6 MB (%11.1) of 512 MB\"}<\/code><\/pre>\n\n\n\n<p>You can fix the Max process and max number of open files warning by adding the lines below to the <code>\/etc\/security\/limits.conf<\/code> file.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>vim \/etc\/security\/limits.conf<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>...\n*               soft    nofile\t\t65000\n*               hard    nofile\t\t65000\n*               soft    nproc\t\t65000\n*               hard    nproc\t\t65000<\/code><\/pre>\n\n\n\n<p>Then restart Apache Solr.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>su - solr -c \"\/opt\/solr\/bin\/solr restart\"<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>Sending stop command to Solr running on port 8983 ... waiting up to 180 seconds to allow Jetty process 4322 to stop gracefully.\nWaiting up to 180 seconds to see Solr running on port 8983 &#91;\\]  \nStarted Solr server on port 8983 (pid=4587). Happy searching!<\/code><\/pre>\n\n\n\n<p>As you can see, Solr is now listening on port 8983;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>ss -altnp | grep 8983<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>LISTEN   0        50                              *:8983                *:*      users:((\"java\",pid=4587,fd=157))<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Accessing Apache Solr Admin Interface<\/h3>\n\n\n\n<p>You can access it via the <strong><code>http:\/\/server-ip-or-resolvable-hostname:8983\/solr<\/code><\/strong>.<\/p>\n\n\n\n<p>If you are not accessing Apache Solr on localhost, you need to allow external access to port 8983\/tcp on Firewalld if it is running.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>firewall-cmd --add-port=8983\/tcp --permanent<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>firewall-cmd --reload<\/code><\/pre>\n\n\n\n<p>And the dashboard looks like as shown in the screenshot below;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1862\" height=\"896\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/11\/solr-dashboard-centos-8.png\" alt=\"Install latest Apache Solr on CentOS 8\" class=\"wp-image-7263\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/11\/solr-dashboard-centos-8.png?v=1605645083 1862w, https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/11\/solr-dashboard-centos-8-768x370.png?v=1605645083 768w, https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/11\/solr-dashboard-centos-8-1536x739.png?v=1605645083 1536w\" sizes=\"(max-width: 1862px) 100vw, 1862px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">Create Apache Solr Core\/Collection<\/h4>\n\n\n\n<p>You can now create Solr Core to start indexing and analyzing your data.<\/p>\n\n\n\n<p>You can create Solr core from the Core Admin interface or from command line using the&nbsp;<code><strong>\/opt\/solr\/bin\/solr<\/strong><\/code>&nbsp;command whose syntax is;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/opt\/solr\/bin\/solr create &#91;-c name] &#91;-d confdir] &#91;-n configName] &#91;-shards #] &#91;-replicationFactor #] &#91;-p port] &#91;-V]<\/code><\/pre>\n\n\n\n<p>The command in short&nbsp;<em>Create a core or collection depending on whether Solr is running in standalone (core) or SolrCloud mode (collection). In other words, this action detects which mode Solr is running in, and then takes the appropriate action (either create_core or create_collection<\/em>).<\/p>\n\n\n\n<p>You can obtain help by executing the commands;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>\/opt\/solr\/bin\/solr create_core -help<\/code><\/pre>\n\n\n\n<p>Or<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>\/opt\/solr\/bin\/solr create_collection -help<\/code><\/pre>\n\n\n\n<p>Refer to <a aria-label=\"Apache Solr core (opens in a new tab)\" href=\"https:\/\/lucene.apache.org\/solr\/guide\/8_7\/installing-solr.html#create-a-core\" target=\"_blank\" rel=\"noreferrer noopener\" class=\"rank-math-link\">Apache Solr create core<\/a> and <a aria-label=\"Apache Solr Collection pages (opens in a new tab)\" href=\"https:\/\/lucene.apache.org\/solr\/guide\/8_7\/collection-management.html#create\" target=\"_blank\" rel=\"noreferrer noopener\" class=\"rank-math-link\">Apache Solr create collection pages<\/a>.<\/p>\n\n\n\n<p>That concludes our guide.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Further Reading<\/h3>\n\n\n\n<p><a href=\"https:\/\/lucene.apache.org\/solr\/guide\/8_7\/deployment-and-operations.html\" target=\"_blank\" aria-label=\"Apache Solr Deployment and Configurations (opens in a new tab)\" rel=\"noreferrer noopener\" class=\"rank-math-link\">Apache Solr Deployment and Configurations<\/a><\/p>\n\n\n\n<p><a aria-label=\"Taking Apache Solr to Production (opens in a new tab)\" href=\"https:\/\/lucene.apache.org\/solr\/guide\/8_7\/taking-solr-to-production.html#taking-solr-to-production\" target=\"_blank\" rel=\"noreferrer noopener\" class=\"rank-math-link\">Taking Apache Solr to Production<\/a><\/p>\n\n\n\n<p><a aria-label=\"Installing Apache Solr (opens in a new tab)\" href=\"https:\/\/lucene.apache.org\/solr\/guide\/8_7\/installing-solr.html\" target=\"_blank\" rel=\"noreferrer noopener\" class=\"rank-math-link\">Installing Apache Solr<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Also Read;<\/h3>\n\n\n\n<p><a aria-label=\" (opens in a new tab)\" href=\"https:\/\/kifarunix.com\/install-latest-apache-solr-on-ubuntu-20-04\/\" target=\"_blank\" rel=\"noreferrer noopener\" class=\"rank-math-link\">Install latest Apache Solr on Ubuntu 20.04<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Other Tutorials<\/h3>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/visualize-wordpress-user-activity-logs-on-elk-stack\/\" target=\"_blank\" aria-label=\" (opens in a new tab)\" rel=\"noreferrer noopener\" class=\"rank-math-link\">Visualize WordPress User Activity Logs on ELK Stack<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/visualize-wordpress-user-activity-logs-on-elk-stack\/\" target=\"_blank\" aria-label=\" (opens in a new tab)\" rel=\"noreferrer noopener\" class=\"rank-math-link\">Quick Way to Install and Configure SNMP on Ubuntu 20.04<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/visualize-wordpress-user-activity-logs-on-elk-stack\/\" target=\"_blank\" aria-label=\" (opens in a new tab)\" rel=\"noreferrer noopener\" class=\"rank-math-link\">Easily Install and Setup Cacti on Ubuntu 20.04<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/visualize-wordpress-user-activity-logs-on-elk-stack\/\" target=\"_blank\" aria-label=\" (opens in a new tab)\" rel=\"noreferrer noopener\" class=\"rank-math-link\">Quickly Setup NTP Server using NTPd on Ubuntu 20.04\/18.04<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Welcome to our tutorial on how to install latest Apache Solr on CentOS 8. Apache Solr&nbsp;is the popular, blazing-fast, open source enterprise search platform built<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[121],"tags":[2879,2881,1142,2878,2880,2873,2883,2882],"class_list":["post-7262","post","type-post","status-publish","format-standard","hentry","category-howtos","tag-apache-solr-centos-8","tag-apache-solr-install-centos-8","tag-centos-8","tag-install-apache-solr-centos-8","tag-install-solr-centos-8","tag-solr","tag-solr-collection","tag-solr-core-create","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/7262"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=7262"}],"version-history":[{"count":3,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/7262\/revisions"}],"predecessor-version":[{"id":21557,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/7262\/revisions\/21557"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=7262"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=7262"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=7262"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}