In this guide, you are going to learn how to install Elasticsearch 7 on Fedora 30. We have covered similar installations in our previous guides.
Install Elasticsearch 7.x on Ubuntu 18.04/Debian 9.8
Install Elasticsearch 7.x on CentOS 7/Fedora 29
Install Elastic Stack 7 on Ubuntu 18.04/Debian 9.8
Install Elasticsearch 7 on Fedora 30
You can install Elasticsearch using the tar.gz archive, RPM binary package or directly from RPM repository. We will discuss the use of RPM binary and RPM repository in this guide.
Note that Elasticsearch comes bundled with its own version of JDK, hence no need to install Java.
Install Elasticsearch 7 using RPM Repository
To install Elasticsearch 7 on Fedora 30 using the RPM repository, perform system update before proceeding
dnf update
dnf upgrade
Import the Elasticsearch PGP Key
Once the system upgrade is done, run the command below to import the Elasticsearch PGP Signing Key.
rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
Add Elasticsearch 7 RPM Repository
To add the Elasticsearch 7 repository on Fedora 30, run the command below
cat > /etc/yum.repos.d/elastic-7.x.repo << EOF
[elasticsearch-7.x]
name=Elasticsearch repository for 7.x packages
baseurl=https://artifacts.elastic.co/packages/7.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md
EOF
Once you have created the Elasticsearch repository, update your system and install Elasticsearch.
dnf update
dnf install elasticsearch
If the installation is successful, you should be able to see such an output snippet.
...
Creating elasticsearch group... OK
Creating elasticsearch user... OK
Installing : elasticsearch-7.1.1-1.x86_64 1/1
Running scriptlet: elasticsearch-7.1.1-1.x86_64 1/1
### NOT starting on installation, please execute the following statements to configure elasticsearch service to start automatically using systemd
sudo systemctl daemon-reload
sudo systemctl enable elasticsearch.service
### You can start elasticsearch service by executing
sudo systemctl start elasticsearch.service
Created elasticsearch keystore in /etc/elasticsearch
Verifying : elasticsearch-7.1.1-1.x86_64 1/1
Installed:
elasticsearch-7.1.1-1.x86_64
Complete!
Install Elasticsearch 7.x using RPM package
To manually install Elasticsearch 7.x on Fedora 30 sing RPM package, download the RPM package.
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.1.1-x86_64.rpm
Next, download the checksum for verifying the integrity of the RPM package.
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.1.1-x86_64.rpm.sha512
Run the integrity check by comparing the checksums. Before that, install perl-Digest-SHA -y
which provides shasum for checksum comparison.
dnf install perl-Digest-SHA -y
shasum -a 512 -c elasticsearch-7.1.1-x86_64.rpm.sha512
If all is well, then you will get an OK output.
elasticsearch-7.1.1-x86_64.rpm: OK
Next, Install Elasticsearch 7.x on Fedora 30
sudo dnf install ./elasticsearch-7.1.1-x86_64.rpm
Running Elasticsearch
Once the installation is done, you can start elasticsearch service by executing;
systemctl daemon-reload
systemctl start elasticsearch
To stop or configure elasticsearch service to start automatically on system boot, run the commands below respectively.
systemctl stop elasticsearch
systemctl enable elasticsearch
To check the status of Elasticsearch;
systemctl status elasticsearch
● elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2019-06-05 08:40:20 EAT; 37min ago
Docs: http://www.elastic.co
Main PID: 27812 (java)
Tasks: 45 (limit: 2351)
Memory: 1.2G
CGroup: /system.slice/elasticsearch.service
├─27812 /usr/share/elasticsearch/jdk/bin/java -Xms1g -Xmx1g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitia>
└─27873 /usr/share/elasticsearch/modules/x-pack-ml/platform/linux-x86_64/bin/controller
If Elasticsearch fails with such error in the logs,
tail -f /var/log/elasticsearch/elasticsearch.log
...
[2019-06-05T07:24:27,752][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [pdns.example.com] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: ElasticsearchException[Failed to create native process factories for Machine Learning]; nested: FileNotFoundException[/tmp/elasticsearch-5386718150248443450/controller_log_24761 (No such file or directory)];
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:163) ~[elasticsearch-7.1.1.jar:7.1.1]
...
You need to check if some Machine Learning X-pack controller Module libraries are missing. Hence, run the command below to verify this.
ldd /usr/share/elasticsearch/modules/x-pack-ml/platform/linux-x86_64/bin/controller | grep "not found"
libcrypt.so.1 => not found
libcrypt.so.1 => not found
libcrypt.so.1 => not found
Therefore, to fix the issue, install the missing libraries. For this case, this libraries can sorted by install the libxcrypt-compat.
dnf install libxcrypt-compat
Verify the missing libraries again.
ldd /usr/share/elasticsearch/modules/x-pack-ml/platform/linux-x86_64/bin/controller | grep "not found"
Next, restart Elasticsearch and verify that it is actually running by executing the command below
curl -XGET localhost:9200
{
"name" : "pdns.example.com",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "VmhyYe9KTnud1y4voHKdrg",
"version" : {
"number" : "7.1.1",
"build_flavor" : "default",
"build_type" : "rpm",
"build_hash" : "7a013de",
"build_date" : "2019-05-23T14:04:00.380842Z",
"build_snapshot" : false,
"lucene_version" : "8.0.0",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}
Another Solution to fix this issue is by disabling the Machine learning capability of Elasticsearch by appending the line xpack.ml.enabled: false to the Elasticsearch configuration file.
echo "xpack.ml.enabled: false" >> /etc/elasticsearch/elasticsearch.yml
If FirewallD is running, you need to open tcp port 9200 on it.
sudo firewall-cmd --add-port=9200/tcp --permanent
sudo firewall-cmd --reload
Great, that is all it takes to install Elasticsearch 7 on Fedora 30.
Check our other articles by following the links below;
Install and Configure Logstash 7 on Ubuntu 18/Debian 9.8
Install and Configure Filebeat 7 on Ubuntu 18.04/Debian 9.8
Install and Setup TIG Stack on Fedora 30