{"id":2726,"date":"2019-04-28T23:32:58","date_gmt":"2019-04-28T20:32:58","guid":{"rendered":"https:\/\/kifarunix.com\/?p=2726"},"modified":"2019-04-28T23:32:59","modified_gmt":"2019-04-28T20:32:59","slug":"install-elasticsearch-7-x-on-centos-7-fedora-29","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-elasticsearch-7-x-on-centos-7-fedora-29\/","title":{"rendered":"Install Elasticsearch 7.x on CentOS 7\/Fedora 29"},"content":{"rendered":"\n

This guide will take you through how to install Elasticsearch 7.x on CentOS 7\/Fedora 29. Elasticsearch<\/a> is the heart of Elastic Stack.<\/p>\n\n\n\n

Our previous guide described how to install Elasticsearch 7.x on Ubuntu 18.04\/Debian 9.8.<\/p>\n\n\n\n

Install Elasticsearch 7.x on Ubuntu 18.04\/Debian 9.8<\/a><\/p>\n\n\n\n

Install Elasticsearch 7.x on CentOS 7\/Fedora 29<\/h2>\n\n\n\n

Again, you can install Elasticsearch using the tar.gz archive, RPM package or from RPM repository. We will discuss the use of RPM and RPM repository in this guide.<\/p>\n\n\n\n

Install Elasticsearch 7.x using RPM Repository<\/h3>\n\n\n\n

To install Elasticsearch 7.x on CentOS 7\/Fedora 29 using the RPM repository, perform system update before proceeding<\/p>\n\n\n\n

On CentOS 7<\/p>\n\n\n\n

yum update
yum upgrade<\/code><\/pre>\n\n\n\n

On Fedora 29<\/p>\n\n\n\n

dnf update
dnf upgrade<\/code><\/pre>\n\n\n\n

Import the Elasticsearch PGP Key<\/h4>\n\n\n\n

Once the system upgrade is done, run the command below to import the Elasticsearch PGP Signing Key.<\/p>\n\n\n\n

rpm --import https:\/\/artifacts.elastic.co\/GPG-KEY-elasticsearch<\/code><\/pre>\n\n\n\n

Add Elasticsearch 7.x RPM Repository<\/h4>\n\n\n\n

To add the Elasticsearch 7.x repository that will allow you to install Elasticsearch 7.0.0 on CentOS 7\/Fedora 29, run the command below<\/p>\n\n\n\n

cat > \/etc\/yum.repos.d\/elastic-7.x.repo << EOF\n[elasticsearch-7.x]\nname=Elasticsearch repository for 7.x packages\nbaseurl=https:\/\/artifacts.elastic.co\/packages\/7.x\/yum\ngpgcheck=1\ngpgkey=https:\/\/artifacts.elastic.co\/GPG-KEY-elasticsearch\nenabled=1\nautorefresh=1\ntype=rpm-md\nEOF<\/code><\/pre>\n\n\n\n

Once you have created the Elasticsearch repository, update your system and install Elasticsearch.<\/p>\n\n\n\n

On CentOS 7<\/p>\n\n\n\n

yum update
yum install elasticsearch<\/code><\/pre>\n\n\n\n

On Fedora 29<\/p>\n\n\n\n

dnf update
dnf install elasticsearch<\/code><\/pre>\n\n\n\n

If the installation is successful, you should be able to see such an output snippet.<\/p>\n\n\n\n

...\nCreating elasticsearch group... OK\nCreating elasticsearch user... OK\n\n  Installing       : elasticsearch-7.0.0-1.x86_64                                                                                                  1\/1 \n  Running scriptlet: elasticsearch-7.0.0-1.x86_64                                                                                                  1\/1 \n### NOT starting on installation, please execute the following statements to configure elasticsearch service to start automatically using systemd\n sudo systemctl daemon-reload\n sudo systemctl enable elasticsearch.service\n### You can start elasticsearch service by executing\n sudo systemctl start elasticsearch.service\n\nCreated elasticsearch keystore in \/etc\/elasticsearch\n\n  Verifying        : elasticsearch-7.0.0-1.x86_64                                                                                                  1\/1 \n\nInstalled:\n  elasticsearch-7.0.0-1.x86_64                                                                                                                         \n\nComplete!<\/code><\/pre>\n\n\n\n

Install Elasticsearch 7.x using RPM package<\/h2>\n\n\n\n

To manually install Elasticsearch 7.0 on CentOS 7\/Fedora 29 using RPM package, download the RPM package.<\/p>\n\n\n\n

wget https:\/\/artifacts.elastic.co\/downloads\/elasticsearch\/elasticsearch-7.0.0-x86_64.rpm<\/code><\/pre>\n\n\n\n

Next, download the checksum for verifying the integrity of the RPM package.<\/p>\n\n\n\n

wget https:\/\/artifacts.elastic.co\/downloads\/elasticsearch\/elasticsearch-7.0.0-x86_64.rpm.sha512
<\/code><\/pre>\n\n\n\n

Run the integrity check by comparing the checksums. Before that, install perl-Digest-SHA -y<\/code> which provides shasum for checksum comparison.<\/p>\n\n\n\n

yum install perl-Digest-SHA -y<\/code>
dnf install perl-Digest-SHA -y
shasum -a 512 -c elasticsearch-7.0.0-x86_64.rpm.sha512
<\/code><\/pre>\n\n\n\n

If all is well, then you will get an OK output.<\/p>\n\n\n\n

elasticsearch-7.0.0-x86_64.rpm: OK<\/code><\/pre>\n\n\n\n

Next, Install Elasticsearch 7.0.0 on CentOS 7\/Fedora 29<\/p>\n\n\n\n

On CentOS 7<\/p>\n\n\n\n

sudo yum localinstall elasticsearch-7.0.0-x86_64.rpm<\/code><\/pre>\n\n\n\n

On Fedora 29<\/p>\n\n\n\n

sudo dnf install .\/elasticsearch-7.0.0-x86_64.rpm<\/code><\/pre>\n\n\n\n

Running Elasticsearch<\/h2>\n\n\n\n

Once the installation is done, you can start elasticsearch service by executing;<\/p>\n\n\n\n

systemctl daemon-reload
systemctl start elasticsearch<\/code><\/pre>\n\n\n\n

To stop or configure elasticsearch service to start automatically on system boot, run the commands below respectively.<\/p>\n\n\n\n

systemctl stop elasticsearch
systemctl enable elasticsearch<\/code><\/pre>\n\n\n\n

To check the status;<\/p>\n\n\n\n

systemctl status elasticsearch
\u25cf elasticsearch.service - Elasticsearch
Loaded: loaded (\/usr\/lib\/systemd\/system\/elasticsearch.service; disabled; vendor preset: disabled)
Active: active (running) since Sun 2019-04-28 23:21:53 EAT; 8s ago
Docs: http:\/\/www.elastic.co
Main PID: 25905 (java)
CGroup: \/system.slice\/elasticsearch.service
\u251c\u250025905 \/usr\/share\/elasticsearch\/jdk\/bin\/java -Xms1g -Xmx1g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInit\u2026
\u2514\u250025969 \/usr\/share\/elasticsearch\/modules\/x-pack-ml\/platform\/linux-x86_64\/bin\/controller
Apr 28 23:21:53 Cent7.example.com systemd[1]: Started Elasticsearch.
Apr 28 23:21:54 Cent7.example.com elasticsearch[25905]: OpenJDK 64-Bit<\/code><\/pre>\n\n\n\n

You can also use curl to check the status.<\/p>\n\n\n\n

curl -X GET \"localhost:9200\/\"\n{\n  \"name\" : \"Cent7.example.com\",\n  \"cluster_name\" : \"elasticsearch\",\n  \"cluster_uuid\" : \"_C5MBUk4So6v7e0qQvRv_g\",\n  \"version\" : {\n    \"number\" : \"7.0.0\",\n    \"build_flavor\" : \"default\",\n    \"build_type\" : \"rpm\",\n    \"build_hash\" : \"b7e28a7\",\n    \"build_date\" : \"2019-04-05T22:55:32.697037Z\",\n    \"build_snapshot\" : false,\n    \"lucene_version\" : \"8.0.0\",\n    \"minimum_wire_compatibility_version\" : \"6.7.0\",\n    \"minimum_index_compatibility_version\" : \"6.0.0-beta1\"\n  },\n  \"tagline\" : \"You Know, for Search\"\n}<\/code><\/pre>\n\n\n\n

If FirewallD is running, you need to open tcp port 9200 on it.<\/p>\n\n\n\n

sudo firewall-cmd --add-port=9200\/tcp --permanent
sudo firewall-cmd --reload<\/code><\/pre>\n\n\n\n

Great, that is all it takes to install Elasticsearch 7.0 on CentOS 7\/Fedora 29. We will cover more about Elastic Stack in our next tutorials. Enjoy.<\/p>\n\n\n\n

Reference:<\/p>\n\n\n\n

Install Elasticsearch with RPM<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"

This guide will take you through how to install Elasticsearch 7.x on CentOS 7\/Fedora 29. Elasticsearch is the heart of Elastic Stack. Our previous guide<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[910,72],"tags":[88,912,911,913,289],"class_list":["post-2726","post","type-post","status-publish","format-standard","hentry","category-elastic-stack","category-monitoring","tag-centos-7","tag-elastic-stack","tag-elasticsearch-7-0","tag-elk","tag-fedora-29","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/2726"}],"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\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=2726"}],"version-history":[{"count":1,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/2726\/revisions"}],"predecessor-version":[{"id":2727,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/2726\/revisions\/2727"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=2726"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=2726"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=2726"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}