{"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
Welcome to our tutorial on how to install latest Apache Solr on CentOS 8. Apache Solr<\/a> 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>. 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 Solr Features as outlined on Apache Solr Features page<\/a>.<\/p>\n\n\n\n Follow through this guide to learn how to install Apache Solr on CentOS 8.<\/p>\n\n\n\n Update your system packages;<\/p>\n\n\n\n Install other tools that are required;<\/p>\n\n\n\n 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 You can verify the version of installed JRE by executing the command below;<\/p>\n\n\n\n Solr 8.7.0 is the most recent Apache Solr release. Hence, navigate their downloads page<\/a> 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 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 Once the download is done, calculate the SHA512 checksum of the Apache Solr archive downloaded;<\/p>\n\n\n\n Compare the hash value with the contents of the SHA512 file downloaded.<\/p>\n\n\n\n Ensure that the hashes match.<\/p>\n\n\n\n Once you verify the integrity of the downloaded archive, extract it as follows;<\/p>\n\n\n\n From the current working directory, execute the command below to install Apache Solr ;<\/p>\n\n\n\n You can fix the Max process and max number of open files warning by adding the lines below to the Then restart Apache Solr.<\/p>\n\n\n\n As you can see, Solr is now listening on port 8983;<\/p>\n\n\n\n You can access it via the 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 And the dashboard looks like as shown in the screenshot below;<\/p>\n\n\n\n You can now create Solr Core to start indexing and analyzing your data.<\/p>\n\n\n\n You can create Solr core from the Core Admin interface or from command line using the The command in short 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 You can obtain help by executing the commands;<\/p>\n\n\n\n Or<\/p>\n\n\n\n Refer to Apache Solr create core<\/a> and Apache Solr create collection pages<\/a>.<\/p>\n\n\n\n That concludes our guide.<\/p>\n\n\n\n Apache Solr Deployment and Configurations<\/a><\/p>\n\n\n\n Taking Apache Solr to Production<\/a><\/p>\n\n\n\n Installing Apache Solr<\/a><\/p>\n\n\n\n Install latest Apache Solr on Ubuntu 20.04<\/a><\/p>\n\n\n\n Visualize WordPress User Activity Logs on ELK Stack<\/a><\/p>\n\n\n\n Quick Way to Install and Configure SNMP on Ubuntu 20.04<\/a><\/p>\n\n\n\n Easily Install and Setup Cacti on Ubuntu 20.04<\/a><\/p>\n\n\n\n\n
Installing Apache Solr on CentOS 8<\/h2>\n\n\n\n
dnf update<\/code><\/pre>\n\n\n\n
dnf install curl wget tar lsof<\/code><\/pre>\n\n\n\n
Install Java Runtime Environment (JRE) on CentOS 8<\/h3>\n\n\n\n
dnf install epel-release<\/code><\/pre>\n\n\n\n
dnf install java-latest-openjdk<\/code><\/pre>\n\n\n\n
java --version<\/code><\/pre>\n\n\n\n
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
Install Apache Solr<\/h3>\n\n\n\n
Download latest Apache Solr release version<\/h4>\n\n\n\n
dnf install wget -y<\/code><\/pre>\n\n\n\n
wget https:\/\/downloads.apache.org\/lucene\/solr\/8.7.0\/solr-8.7.0.tgz<\/code><\/pre>\n\n\n\n
Verify Integrity of Apache Solr Archive<\/h4>\n\n\n\n
wget https:\/\/downloads.apache.org\/lucene\/solr\/8.7.0\/solr-8.7.0.tgz.sha512<\/code><\/pre>\n\n\n\n
gpg --print-md SHA512 solr-8.7.0.tgz<\/code><\/pre>\n\n\n\n
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
cat solr-8.7.0.tgz.sha512<\/code><\/pre>\n\n\n\n
15a3af83997e2cbc4bfed304f7d43efd260674d98059241605ff3cde0ae02d8bd1ccd56973c6cba1cc11895655bb76fcf1991bbb94b004e517ce15f728fa163f *solr-8.7.0.tgz<\/code><\/pre>\n\n\n\n
Extract Apache Solr Archive<\/h4>\n\n\n\n
tar xzf solr-8.7.0.tgz<\/code><\/pre>\n\n\n\n
Install Apache Solr on CentOS 8<\/h4>\n\n\n\n
solr-8.7.0\/bin\/install_solr_service.sh solr-8.7.0.tgz<\/code><\/pre>\n\n\n\n
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 -> \/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*** [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*** [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
\/etc\/security\/limits.conf<\/code> file.<\/p>\n\n\n\n
vim \/etc\/security\/limits.conf<\/code><\/pre>\n\n\n\n
...\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
su - solr -c \"\/opt\/solr\/bin\/solr restart\"<\/code><\/pre>\n\n\n\n
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 [\\] \nStarted Solr server on port 8983 (pid=4587). Happy searching!<\/code><\/pre>\n\n\n\n
ss -altnp | grep 8983<\/code><\/pre>\n\n\n\n
LISTEN 0 50 *:8983 *:* users:((\"java\",pid=4587,fd=157))<\/code><\/pre>\n\n\n\n
Accessing Apache Solr Admin Interface<\/h3>\n\n\n\n
http:\/\/server-ip-or-resolvable-hostname:8983\/solr<\/code><\/strong>.<\/p>\n\n\n\n
firewall-cmd --add-port=8983\/tcp --permanent<\/code><\/pre>\n\n\n\n
firewall-cmd --reload<\/code><\/pre>\n\n\n\n
<\/figure>\n\n\n\n
Create Apache Solr Core\/Collection<\/h4>\n\n\n\n
\/opt\/solr\/bin\/solr<\/strong><\/code> command whose syntax is;<\/p>\n\n\n\n
\/opt\/solr\/bin\/solr create [-c name] [-d confdir] [-n configName] [-shards #] [-replicationFactor #] [-p port] [-V]<\/code><\/pre>\n\n\n\n
\/opt\/solr\/bin\/solr create_core -help<\/code><\/pre>\n\n\n\n
\/opt\/solr\/bin\/solr create_collection -help<\/code><\/pre>\n\n\n\n
Further Reading<\/h3>\n\n\n\n
Also Read;<\/h3>\n\n\n\n
Other Tutorials<\/h3>\n\n\n\n