Prerequisites
The tasks discussed in this section require the following:
Firewall and SELinux
Security-related software (iptables, SELinux, AppArmor) may be configured by default to block communication between subsystems. It may be a good idea to check them if there are problems.
Set up rules for iptables and SELinux
To set up rules to allow communication with the firewall or SELinux enabled, consult the following resources:
Install the Java Software Development Kit
To determine if Java is already installed, enter the following command:
java -version
If the message java: command not found
displays, you must install the Java SDK as discussed in the next section.
See one of the following sections:
Install the JDK on CentOS
See this Digital Ocean tutorial.
Be sure to install the JDK and not the JRE.
yum -y install java-1.8.0-openjdk
Install the JDK on Ubuntu
To install JDK 1.8 on Ubuntu, enter the following commands as a user with root
privileges:
apt-get -y update
apt-get install -y openjdk-8-jdk
For other options, see Oracle documentation.
Install the search engine
Follow Installing Elasticsearch or Install and configure OpenSearch for your platform-specific steps.
To verify that Elasticsearch is working, enter the following command on the server on which it is running:
curl -XGET '<host>:9200/_cat/health?v&pretty'
A message similar to the following is displayed:
epoch timestamp cluster status node.total node.data shards pri relo init unassign pending_tasks
1519701563 03:19:23 elasticsearch green 1 1 0 0 0 0 0 0
To verify OpenSearch is working, enter the following commands:
curl -XGET https://<host>:9200 -u 'admin:admin' --insecure
curl -XGET https://<host>:9200/_cat/plugins?v -u 'admin:admin' --insecure
Upgrading Elasticsearch
Refer to Upgrading Elasticsearch for full instructions on backing up your data, detecting potential migration issues, and testing upgrades before deploying to production. Depending on your current version of Elasticsearch, a full cluster restart may or may not be required.
Elasticsearch requires JDK 1.8 or higher. See Install the Java Software Development Kit to check which version of JDK is installed.
Additional resources
See the Elasticsearch or OpenSearch documentation.