Introduction
This guide explains how to install Elasticsearch. There is no information regarding the provision and configuration of Elasticsearch, as this is not a package or service maintained as a part of cPanel.
Please note the purpose of this guide is purely informational and as such cPanel, LLC will not assume responsibility for any potential adverse outcomes that might arise from its adoption.
You may, therefore, wish to seek assistance from a qualified system administrator regarding this issue, as one would have the tools and knowledge in order to adjust this for you. You can refer to this link for more information:
System Administration Services
Procedure
Before you begin, ensure that your server meets the minimum requirements for ElasticSearch. 4GB of RAM and 2 CPUs is recommended. Not meeting these requirements could result in your instance being killed prematurely when the server runs out of memory.
- ElasticSearch requires Java to be installed on your server. You can install the Java Development Kit package provided by your operating system repo:
yum install java
- To verify the installation, run the following command. If it returns successfully, the runtime was properly installed:
java -version
- Before installing Elasticsearch, add the elastic.co key to the server:
rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
- Next, add the Elastic repository. Create the repo file in the yum.repos.d directory:
touch /etc/yum.repos.d/elasticsearch.repo
- Using your preferred text editor, add the repo contents to the file:
[elasticsearch-6.x]
name=Elasticsearch repository for 6.x packages
baseurl=https://artifacts.elastic.co/packages/6.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md - Save the file and return to the command line. Install the ElasticSearch package:
sudo yum install elasticsearch
- Once Elasticsearch is finished installing, open its main configuration file in your preferred text editor:
/etc/elasticsearch/elasticsearch.yml
-
By default, Elasticsearch listens for traffic from everywhere on port 9200. To secure your installation, find the line that specifies network.host, uncomment it, and replace its value with localhost so it looks like this:
...
network.host: localhost
... - After the installation is complete, the Elasticsearch service needs to be enabled and then started by using the following commands:
/bin/systemctl daemon-reload
/bin/systemctl enable elasticsearch.service
/bin/systemctl start elasticsearch.service
/bin/systemctl status elasticsearch.service
Additional Information:
cPanel, LLC only supports the cPanel-provided software and does not provide support for any third-party software. For questions regarding Elasticsearch, therefore, you need to use Elasticsearch support options accessible via these links:
Working with Elastic Support: Best Practices
Comments
0 comments
Article is closed for comments.