Prerequisites
Ensure Java runtime is available before proceeding.
yum -y install java-1.8.0-openjdk
Fetching and Installing Elasticsearch
Retrieve the package and install via RPM.
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.10.1-x86_64.rpm
rpm -ivh elasticsearch-7.10.1-x86_64.rpm
Service Initialization and Startup
Reload service definitions and configure automatic startup.
systemctl daemon-reload
systemctl enable elasticsearch
systemctl start elasticsearch
systemctl status elasticsearch
Cluster and Node Settings
Edit /etc/elasticsearch/elasticsearch.yml with the following parameters:
cluster.name: search-cluster
node.name: primary-node
path.data: /mnt/data/es
path.logs: /var/log/elasticsearch
bootstrap.memory_lock: true
network.host: 10.0.1.129
http.port: 9200
http.cors.enabled: true
http.cors.allow-origin: "*"
cluster.initial_master_nodes: ["primary-node"]
Apply filesystem changes and adjust ownership:
mkdir -p /mnt/data/es
chown -R elasticsearch:elasticsearch /mnt/data/es
systemctl restart elasticsearch
systemctl status elasticsearch
Memory locking may cause startup failure. To resolve, raise the memlock limit for the service.
Either invoke an override:
systemctl edit elasticsearch
Or modify the unit file directly:
vim /usr/lib/systemd/system/elasticsearch.service
Append with in the [Service] section:
LimitMEMLOCK=infinity
Refresh systemd and relaunch the process:
systemctl daemon-reload
systemctl restart elasticsearch
Monitor logs using the cluster-specific logfile:
tailf /var/log/elasticsearch/search-cluster.log
Optional Plugin Setup
Navigate to the binary directory of Elastiscearch:
cd /usr/share/elasticsearch/bin
Install the ICU analysis plugin:
./elasticsearch-plugin install analysis-icu
./elasticsearch-plugin list