RPM package
Installing and running Open Distro for Elasticsearch from an RPM package is a more manual process than the Docker image. We recommend CentOS 7 and Amazon Linux 2, but any RPM-based distribution that uses systemd should work. These steps assume you’re using CentOS 7.
-
cd /etc/yum.repos.d/
-
sudo curl https://d3g5vo6xdbdb9a.cloudfront.net/yum/opendistroforelasticsearch-artifacts.repo -o opendistroforelasticsearch-artifacts.repo
You can also create the file manually. It looks like this:
[elasticsearch-6.x] name=Elasticsearch repository for 6.x packages baseurl=https://artifacts.elastic.co/packages/oss-6.x/yum gpgcheck=1 gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch enabled=1 autorefresh=1 type=rpm-md [opendistroforelasticsearch-artifacts-repo] name=Release RPM artifacts of OpenDistroForElasticsearch baseurl=https://d3g5vo6xdbdb9a.cloudfront.net/yum/noarch/ enabled=1 gpgkey=https://d3g5vo6xdbdb9a.cloudfront.net/GPG-KEY-opendistroforelasticsearch gpgcheck=1 repo_gpgcheck=1 autorefresh=1 type=rpm-md
-
Open Distro for Elasticseach requires the full Java Development Kit (JDK), not just the Java Runtime Environment (JRE). If you don’t have the JDK installed, install either version 8 or version 11:
# Java 11 sudo yum install java-11-openjdk-devel # Java 8 sudo yum install java-1.8.0-openjdk-devel
If you’re using Amazon Linux 2, you might need to use Java 8.
-
sudo yum install opendistroforelasticsearch
-
If you installed Java 8, run the following command:
sudo ln -s /usr/lib/jvm/java-1.8.0/lib/tools.jar /usr/share/elasticsearch/lib/
-
To start Open Distro for Elasticsearch:
sudo systemctl start elasticsearch.service
-
Send requests to the server to verify that Elasticsearch is up and running:
curl -XGET https://localhost:9200 -u admin:admin --insecure curl -XGET https://localhost:9200/_cat/nodes?v -u admin:admin --insecure curl -XGET https://localhost:9200/_cat/plugins?v -u admin:admin --insecure
-
For instructions on installing and running Kibana, see Kibana.
-
To check the status of the service:
systemctl status elasticsearch.service
You might notice some errors if you are using Java 8. If the service is still
active (running)
, you can safely ignore them:elasticsearch[3969]: java.security.policy: error adding Entry: elasticsearch[3969]: java.net.MalformedURLException: unknown protocol: jrt elasticsearch[3969]: java.security.policy: error adding Entry: elasticsearch[3969]: java.net.MalformedURLException: unknown protocol: jrt
-
To stop Open Distro for Elasticsearch:
sudo systemctl stop elasticsearch.service
Configuration
To run Open Distro for Elasticsearch when the system starts:
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable elasticsearch.service
You can also modify the values in /etc/sysconfig/elasticsearch
(JAVA_HOME
, most notably), /etc/elasticsearch/elasticsearch.yml
, and /etc/elasticsearch/jvm.options
(to set the heap size, most notably). To learn more, see Elasticsearch configuration and Important Settings on the Docker page.
Where are the files?
The RPM package installs files to the following locations:
File type | Location |
---|---|
Elasticsearch home, management scripts, and plugins | /usr/share/elasticsearch/ |
Configuration files | /etc/elasticsearch |
Environment variables | /etc/sysconfig/elasticsearch |
Logs | /var/log/elasticsearch |
Shard data | /var/lib/elasticsearch |