Centos7.4 deployment configuration Elasticsearch5.6 cluster

Reference document###

https://www.elastic.co/guide/en/elasticsearch/reference/5.6/index.html
https://www.elastic.co/guide/cn/elasticsearch/guide/current/important-configuration-changes.html
https://www.elastic.co/guide/en/elasticsearch/reference/master/setting-system-settings.html

1. Environment###

1、 System environment

cat /etc/security/limits.conf 
elasticsearch soft memlock unlimited
elasticsearch hard memlock unlimited
elasticsearch soft nofile 131072
elasticsearch hard nofile 131072
elasticsearch soft nproc 4096
elasticsearch hard nproc 4096

2、 JAVA environment

java -version
openjdk version "1.8.0_161"
OpenJDK Runtime Environment (build 1.8.0_161-b14)
OpenJDK 64-Bit Server VM (build 25.161-b14, mixed mode)

Two, installation and configuration###

1、 installation
rpm -qa |grep elas
elasticsearch-5.6.8-1.noarch

Note that memory locking needs to be configured in the Centos7.4 service, and the file /etc/systemd/system/elasticsearch.service.d/override.conf needs to be modified. Reference https://www.elastic.co/guide/en/elasticsearch/reference/master/setting-system-settings.html
EDITOR=vim systemctl edit elasticsearch

[ Service]
LimitMEMLOCK=infinity

systemctl daemon-reload

2、 Configuration

Note that the default configuration is fine. Most of the parameters are just by default. The official tuning has been done. Especially in Centos7, there is no need to add them in the configuration file. Only those configurations that must be modified according to the actual situation need to be filled in.

1 ), master node configuration

cat /etc/elasticsearch/elasticsearch.yml
cluster.name: roobo-escluster
node.name: master-01
node.master: true
node.ingest: true
node.data: false
path.data: /data/es-data01,/data/es-data02
path.logs: /data/es-data01/eslogs
bootstrap.memory_lock: true
network.host: 172.20.3.17
http.port: 9200
discovery.zen.ping.unicast.hosts: ["172.20.3.17:9300","172.20.3.18:9300","172.20.3.19:9300"]
discovery.zen.minimum_master_nodes: 2
gateway.recover_after_nodes: 6
gateway.expected_nodes: 8
gateway.recover_after_time: 5m
http.cors.enabled: true
http.cors.allow-origin: "*"

2 ), data node configuration

cat /etc/elasticsearch/elasticsearch.yml
cluster.name: roobo-escluster
node.name: data-01
node.master: false
node.ingest: false
node.data: true
path.data: /data/es-data01,/data/es-data02
path.logs: /data/es-data01/eslogs
bootstrap.memory_lock: true
network.host: 172.20.3.20
http.port: 9200
discovery.zen.ping.unicast.hosts: ["172.20.3.17:9300","172.20.3.18:9300","172.20.3.19:9300"]
discovery.zen.minimum_master_nodes: 2
gateway.recover_after_nodes: 6
gateway.expected_nodes: 8
gateway.recover_after_time: 5m
http.cors.enabled: true
http.cors.allow-origin: "*"

3 ), jvm tuning

By default, only the size of HEAP needs to be adjusted, preferably no more than 50% of the memory, and no more than 31G for large memory servers

cat /etc/elasticsearch/jvm.options |egrep 'Xms|Xmx'

  • Xms14g
  • Xmx14g

3、 boot

systemctl enable elasticsearch

Three, Elasticsearch common operations

View nodes

curl http://172.20.3.20:9200/_cat/nodes?v
ip heap.percent ram.percent cpu load_1m load_5m load_15m node.role master name
172.20.3.20 4 57 0 0.04 0.03 0.05 d - data-01
172.20.3.18 4 60 0 0.05 0.03 0.05 mi - master-02
172.20.3.24 5 57 0 0.00 0.01 0.05 d - data-05
172.20.3.19 9 38 0 0.02 0.02 0.05 mi - master-03
172.20.3.21 4 57 0 0.00 0.02 0.05 d - data-02
172.20.3.23 5 57 0 0.00 0.01 0.05 d - data-04
172.20.3.22 3 57 0 0.00 0.01 0.05 d - data-03
172.20.3.17 4 68 0 0.00 0.01 0.05 mi * master-01
View nodes status curl http://172.20.3.20:9200/_nodes/stats?pretty View cluster health status curl http://172.20.3.20:9200/_cluster/health?pretty
curl http://172.20.3.20:9200/_cluster/health?level=indices
curl http://172.20.3.20:9200/_cluster/health?level=shards
Find index curl http://172.20.3.20:9200/_cat/indices?bytes=b | sort -rnk8 |grep -V marvel
View settings curl http://172.20.3.20:9200/_cluster/settings?pretty

Recommended Posts

Centos7.4 deployment configuration Elasticsearch5.6 cluster
Elasticsearch cluster deployment record under CentOS7
RabbitMQ cluster deployment record under Centos6.9
Centos7 hadoop cluster installation and configuration
k8s practice (1): Centos 7.6 deployment k8s (v1.14.2) cluster
CentOS 7.0 network configuration
MySQL 8.0 installation, deployment and configuration under CentOS 6/7
CentOS7 basic configuration
Centos MySQL8 configuration
CentOS deployment Harbor
Distributed deployment of Apollo configuration center under CentOS8
MySQL 8.0 installation, deployment and configuration tutorial on CentOS 8
Xfs configuration on centos7
CentOS7.3.1611 deploys k8s1.5.2 cluster
Centos6.9 build rabbitmq 3.6.8 cluster
Centos install elasticsearch tutorial
CentOS server deployment (YUM)
CentOS6 install couchdb2 cluster
Centos kernel compilation configuration
CentOS 6.8 deploy zookeeper cluster
Centos7 build Kubernetes cluster
Centos7 mqtt cluster installation
Mysql8.0.15 installation configuration (centos7)
CentOS cluster related issues
Centos7 deploys Kubernetes cluster
CentOS7 deploys k8s cluster
Install Elasticsearch 6 on centos7
CentOS7.6 server deployment VNC
Rapid deployment of Kubernetes (k8s) cluster in CentOS7 environment
[CentOS environment deployment] Java7/Java8 deployment under CentOS
Install ElasticSearch 7.x on CentOS 7
CentOS7 install rabbitmq cluster (binary)
Glusterfs cluster installation on Centos7
Redis cluster installation under CentOS
Centos7 installation and configuration prometheus
CentOS 7 Galera Cluster installation guide
Centos7.2/7.3 cluster install Kubernetes 1.8.4 + Dashboard
CentOS 7 installation and configuration PPTP
Deployment of graphite on centos7
CentOS installation and configuration cmake
CentOS 7 user account configuration original
Centos7.5 installation and configuration MongoDB4.0.4
Redis cluster installation under CentOS
CentOS 7 installation and configuration PPTP
CentOS mysql configuration master-slave replication
Implementation of CentOS8.0 Network Configuration
Centos7.2 deployment vnc service record
CentOS 7 Redis 5.0.8 sentinel mode configuration
CentOs7.3 build SolrCloud cluster service
CentOS8 network card configuration file
Centos7 install k8s cluster 1.15.0 version
Ceph rapid deployment (Centos7 + Jewel)
Using Elastic Stack on CentOS 8: Deployment and authentication configuration of Elasticsearch/Kibana 7.8
Centos7 installation and configuration of Jenkins
CentOS 8 install Git and basic configuration
Centos6.5 installation and deployment of KVM
How to install Elasticsearch on CentOS 8
CentOS configuration git server in VirtualBox
Build a PXC cluster under CentOS8
CentOS7.2 and Nginx configuration virtual host
Detailed examples of Centos6 network configuration