CentOS 7
Sponsored Link

Elastic Stack 7 : Elasticsearch Cluster2019/06/18

 
Configure Elasticsearch Cluster.
This example shows to configure Elasticsearch Cluster with 3 Nodes and configure each Node is Master Eligible Node and Data Node (default).
Each node serves one or more purpose, refer to details below.
⇒ https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-node.html

[1]
[2] Change settings on all Nodes like follows.
[root@node01 ~]#
vi /etc/elasticsearch/elasticsearch.yml
# line 17: uncomment and change (any name you like)

cluster.name:
elastic-cluster
# line 23: uncomment and change (set Hostanme for node name)

node.name:
${HOSTNAME}
# line 55: uncomment and change (listen all)

network.host:
0.0.0.0
# line 73: add (specify all Nodes - the Nonde name should be the same with [node.name]

cluster.initial_master_nodes:
  - node01.srv.world
  - node02.srv.world
  - node03.srv.world

[root@node01 ~]#
systemctl start elasticsearch

[root@node01 ~]#
systemctl enable elasticsearch

[3] If Firewalld is running, allow service ports.
[root@node01 ~]#
firewall-cmd --add-port={9200/tcp,9300/tcp} --permanent

success
[root@node01 ~]#
firewall-cmd --reload

success
[4] Make sure Cluster status. If the status is green, it's OK.
[root@node01 ~]#
curl http://10.0.0.51:9200/_cluster/health?pretty

{
  "cluster_name" : "elastic-cluster",
  "status" : "green",
  "timed_out" : false,
  "number_of_nodes" : 3,
  "number_of_data_nodes" : 3,
  "active_primary_shards" : 0,
  "active_shards" : 0,
  "relocating_shards" : 0,
  "initializing_shards" : 0,
  "unassigned_shards" : 0,
  "delayed_unassigned_shards" : 0,
  "number_of_pending_tasks" : 0,
  "number_of_in_flight_fetch" : 0,
  "task_max_waiting_in_queue_millis" : 0,
  "active_shards_percent_as_number" : 100.0
}
Matched Content