es에서 노드들을 어떻게 발견할까?
discovery.seed_hosts에 array값으로 initial nodes list를 주기는 하지만
그 이후에 노드가 추가, 삭제되는 경우는 어떻게될까?

# Discovery :  discovery.seed_hosts
discovery는 cluster formation module이 클러스터를 형성하는 다른 노드들을 찾는 과정을 의미한다.
(cluster formation module이 있고 역할에 따라 나뉘는데 그 중에 하나가 discovery임.)
이 과정은 es노드를 시작할때 또는 노드에서 마스터 노드가 실패했다고 판단될때 실행되는데,
마스터 노드가 발견되거나 새로 선출될때까지 계속해서 실행된다.

이 과정은 seed hosts 리스트에 의해 시작되고,
프로세스는 두 단계로 동작하는데
* 첫째 각 노드는 연결된 노드를 식별하고, 마스터 자격이 있는지 확인하여 seed 주소를 검사함
* 둘째 성공하면 원격 노드와 알려진 master-eligible 노드 목록을 모두 공유하고 원격 노드는 피어와 차례로 응답.
그런 다음 노드는 방금 발견한 새 노드들을 검사하고, 피어를 요청하는 등의 작업을 수행.
노드가 마스터 자격이 없는 경우 선택된 마스터 노드를 감지할때까지 이 감지 프로세스가 계속됨.

결론은 새로운 노드를 추가할때에 master-eligible nodes를 포함하는 클러스터의 모든 리스트를 
discover.seed_hosts에 기입해주고, 띄우면 master-eligible nodes에서 discovery하는 듯.
원래 있던 노드의 discovery.seed_hosts까지 수정해서 재시작해줄필요 없음.

# cluster.initial_master_nodes
최초 bootstrap당시의 master-eligible-nodes 목록임.
새 노드를 기존 클러스터에 추가할때는 master-eligible nodes를 포함하여 모두 discovery.seed_hosts에만 넣어주면되고,
initial_master_nodes 셋팅 해 줄 필요없음.
대신, inital_master_nodes에 설정된 master-eligible-nodes들 중에서 과반수 이상이 살아있어야 클러스터가 정상적으로 실행됨.

* discovery에 대하여.
https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery-hosts-providers.html

 

Discovery | Elasticsearch Reference [7.6] | Elastic

Discovery is the process by which the cluster formation module finds other nodes with which to form a cluster. This process runs when you start an Elasticsearch node or when a node believes the master node failed and continues until the master node is foun

www.elastic.co

* cluster.initial_master_nodes에 대하여. discovery에 사용되는 여러 셋팅값들.
https://www.elastic.co/guide/en/elasticsearch/reference/current/discovery-settings.html#unicast.hosts

 

Important discovery and cluster formation settings | Elasticsearch Reference [7.6] | Elastic

Important discovery and cluster formation settingsedit There are two important discovery and cluster formation settings that should be configured before going to production so that nodes in the cluster can discover each other and elect a master node. disco

www.elastic.co

 

+ Recent posts