본문 바로가기
ElasticSearch

[ElasticSearch]클러스터에 노드 2개 붙이기...

by Rainbound-IT 2022. 9. 27.
반응형

각 노드에 

처음 실행할때 seed_host와 initial_master_nodes 를 설정을 하고 실행시켜야한다.

 

 

 

node-1

[2022-09-27T07:44:01,557][WARN ][o.e.c.c.ClusterFormationFailureHelper] [node-1] master not discovered yet, this node has not previously joined a bootstrapped cluster, and this node must discover master-eligible nodes [node-1, node-2] to bootstrap a cluster: have discovered [{node-1}{NBsKhaguTKiH_JNJ6DkRYw}{zmC5Tel1QIWGl1eUq4fLXQ}{node-1}{10.20.0.10}{10.20.0.10:9300}{dm}]; discovery will continue using [10.0.20.10:9300, 10.0.20.10:9301] from hosts providers and [{node-1}{NBsKhaguTKiH_JNJ6DkRYw}{zmC5Tel1QIWGl1eUq4fLXQ}{node-1}{10.20.0.10}{10.20.0.10:9300}{dm}] from last-known cluster state; node term 0, last-accepted version 0 in term 0

이상태에서 node-2를 올려줘야한다.

 

[2022-09-27T07:58:15,682][INFO ][o.e.e.NodeEnvironment    ] [node-1] using [1] data paths, mounts [[/ (/dev/mapper/ubuntu--vg-ubuntu--lv)]], net usable_space [75.4gb], net total_space [94.9gb], types [ext4]
[2022-09-27T07:58:15,683][INFO ][o.e.e.NodeEnvironment    ] [node-1] heap size [3.8gb], compressed ordinary object pointers [true]
[2022-09-27T07:58:15,735][INFO ][o.e.n.Node               ] [node-1] node name [node-1], node ID [NBsKhaguTKiH_JNJ6DkRYw], cluster name [my-application], roles [data, master]
[2022-09-27T07:58:17,860][INFO ][o.e.x.s.Security         ] [node-1] Security is disabled
[2022-09-27T07:58:17,914][INFO ][o.e.x.m.p.l.CppLogMessageHandler] [node-1] [controller/3758] [Main.cc@123] controller (64 bit): Version 8.3.3 (Build d2d2e518384d45) Copyright (c) 2022 Elasticsearch BV
[2022-09-27T07:58:18,264][INFO ][o.e.t.n.NettyAllocator   ] [node-1] creating NettyAllocator with the following configs: [name=elasticsearch_configured, chunk_size=1mb, suggested_max_allocation_size=1mb, factors={es.unsafe.use_netty_default_chunk_and_page_size=false, g1gc_enabled=true, g1gc_region_size=4mb}]
[2022-09-27T07:58:18,287][INFO ][o.e.i.r.RecoverySettings ] [node-1] using rate limit [40mb] with [default=40mb, read=0b, write=0b, max=0b]
[2022-09-27T07:58:18,311][INFO ][o.e.d.DiscoveryModule    ] [node-1] using discovery type [multi-node] and seed hosts providers [settings]
[2022-09-27T07:58:19,167][INFO ][o.e.n.Node               ] [node-1] initialized
[2022-09-27T07:58:19,167][INFO ][o.e.n.Node               ] [node-1] starting ...
[2022-09-27T07:58:19,180][INFO ][o.e.x.s.c.f.PersistentCache] [node-1] persistent cache index loaded
[2022-09-27T07:58:19,181][INFO ][o.e.x.d.l.DeprecationIndexingComponent] [node-1] deprecation component started
[2022-09-27T07:58:19,255][INFO ][o.e.t.TransportService   ] [node-1] publish_address {10.0.20.10:9300}, bound_addresses {[::]:9300}
[2022-09-27T07:58:19,368][INFO ][o.e.b.BootstrapChecks    ] [node-1] bound or publishing to a non-loopback address, enforcing bootstrap checks
[2022-09-27T07:58:19,370][INFO ][o.e.c.c.ClusterBootstrapService] [node-1] this node has not joined a bootstrapped cluster yet; [cluster.initial_master_nodes] is set to [node-1, node-2]
[2022-09-27T07:58:19,466][INFO ][o.e.c.c.Coordinator      ] [node-1] setting initial configuration to VotingConfiguration{NBsKhaguTKiH_JNJ6DkRYw,H1mWOBmNQAifDqiTluuZfQ}
[2022-09-27T07:58:20,220][INFO ][o.e.c.c.CoordinationState] [node-1] cluster UUID set to [LxYBaukbSlu179NrOUwppw]
[2022-09-27T07:58:20,242][INFO ][o.e.c.s.ClusterApplierService] [node-1] master node changed {previous [], current [{node-2}{H1mWOBmNQAifDqiTluuZfQ}{A2VYg-_PQpOyZzJQyR1t_Q}{node-2}{10.0.20.10}{10.0.20.10:9301}{dm}]}, added {{node-2}{H1mWOBmNQAifDqiTluuZfQ}{A2VYg-_PQpOyZzJQyR1t_Q}{node-2}{10.0.20.10}{10.0.20.10:9301}{dm}}, term: 73, version: 1, reason: ApplyCommitRequest{term=73, version=1, sourceNode={node-2}{H1mWOBmNQAifDqiTluuZfQ}{A2VYg-_PQpOyZzJQyR1t_Q}{node-2}{10.0.20.10}{10.0.20.10:9301}{dm}{xpack.installed=true}}
[2022-09-27T07:58:20,254][INFO ][o.e.h.AbstractHttpServerTransport] [node-1] publish_address {10.0.20.10:9200}, bound_addresses {[::]:9200}
[2022-09-27T07:58:20,254][INFO ][o.e.n.Node               ] [node-1] started {node-1}{NBsKhaguTKiH_JNJ6DkRYw}{KZiJqcHuSPuHQ_XGlkOC2A}{node-1}{10.0.20.10}{10.0.20.10:9300}{dm}{xpack.installed=true}

 

 

 

 

node-2 

[2022-09-27T07:58:00,925][INFO ][o.e.e.NodeEnvironment    ] [node-2] using [1] data paths, mounts [[/ (/dev/mapper/ubuntu--vg-ubuntu--lv)]], net usable_space [75.4gb], net total_space [94.9gb], types [ext4]
[2022-09-27T07:58:00,926][INFO ][o.e.e.NodeEnvironment    ] [node-2] heap size [3.8gb], compressed ordinary object pointers [true]
[2022-09-27T07:58:00,997][INFO ][o.e.n.Node               ] [node-2] node name [node-2], node ID [H1mWOBmNQAifDqiTluuZfQ], cluster name [my-application], roles [data, master]
[2022-09-27T07:58:08,989][INFO ][o.e.x.s.Security         ] [node-2] Security is disabled
[2022-09-27T07:58:09,089][INFO ][o.e.x.m.p.l.CppLogMessageHandler] [node-2] [controller/3646] [Main.cc@123] controller (64 bit): Version 8.3.3 (Build d2d2e518384d45) Copyright (c) 2022 Elasticsearch BV
[2022-09-27T07:58:09,666][INFO ][o.e.t.n.NettyAllocator   ] [node-2] creating NettyAllocator with the following configs: [name=elasticsearch_configured, chunk_size=1mb, suggested_max_allocation_size=1mb, factors={es.unsafe.use_netty_default_chunk_and_page_size=false, g1gc_enabled=true, g1gc_region_size=4mb}]
[2022-09-27T07:58:09,710][INFO ][o.e.i.r.RecoverySettings ] [node-2] using rate limit [40mb] with [default=40mb, read=0b, write=0b, max=0b]
[2022-09-27T07:58:09,766][INFO ][o.e.d.DiscoveryModule    ] [node-2] using discovery type [multi-node] and seed hosts providers [settings]
[2022-09-27T07:58:11,101][INFO ][o.e.n.Node               ] [node-2] initialized
[2022-09-27T07:58:11,102][INFO ][o.e.n.Node               ] [node-2] starting ...
[2022-09-27T07:58:11,357][INFO ][o.e.x.s.c.f.PersistentCache] [node-2] persistent cache index loaded
[2022-09-27T07:58:11,358][INFO ][o.e.x.d.l.DeprecationIndexingComponent] [node-2] deprecation component started
[2022-09-27T07:58:11,480][INFO ][o.e.t.TransportService   ] [node-2] publish_address {10.0.20.10:9301}, bound_addresses {[::]:9301}
[2022-09-27T07:58:11,676][INFO ][o.e.b.BootstrapChecks    ] [node-2] bound or publishing to a non-loopback address, enforcing bootstrap checks
[2022-09-27T07:58:11,679][INFO ][o.e.c.c.ClusterBootstrapService] [node-2] this node has not joined a bootstrapped cluster yet; [cluster.initial_master_nodes] is set to [node-1, node-2]
[2022-09-27T07:58:20,180][INFO ][o.e.c.s.MasterService    ] [node-2] elected-as-master ([2] nodes joined)[_FINISH_ELECTION_, {node-1}{NBsKhaguTKiH_JNJ6DkRYw}{KZiJqcHuSPuHQ_XGlkOC2A}{node-1}{10.0.20.10}{10.0.20.10:9300}{dm} completing election, {node-2}{H1mWOBmNQAifDqiTluuZfQ}{A2VYg-_PQpOyZzJQyR1t_Q}{node-2}{10.0.20.10}{10.0.20.10:9301}{dm} completing election], term: 73, version: 1, delta: master node changed {previous [], current [{node-2}{H1mWOBmNQAifDqiTluuZfQ}{A2VYg-_PQpOyZzJQyR1t_Q}{node-2}{10.0.20.10}{10.0.20.10:9301}{dm}]}, added {{node-1}{NBsKhaguTKiH_JNJ6DkRYw}{KZiJqcHuSPuHQ_XGlkOC2A}{node-1}{10.0.20.10}{10.0.20.10:9300}{dm}}
[2022-09-27T07:58:20,219][INFO ][o.e.c.c.CoordinationState] [node-2] cluster UUID set to [LxYBaukbSlu179NrOUwppw]
[2022-09-27T07:58:20,259][INFO ][o.e.c.s.ClusterApplierService] [node-2] master node changed {previous [], current [{node-2}{H1mWOBmNQAifDqiTluuZfQ}{A2VYg-_PQpOyZzJQyR1t_Q}{node-2}{10.0.20.10}{10.0.20.10:9301}{dm}]}, added {{node-1}{NBsKhaguTKiH_JNJ6DkRYw}{KZiJqcHuSPuHQ_XGlkOC2A}{node-1}{10.0.20.10}{10.0.20.10:9300}{dm}}, term: 73, version: 1, reason: Publication{term=73, version=1}
[2022-09-27T07:58:20,285][INFO ][o.e.c.r.a.DiskThresholdMonitor] [node-2] skipping monitor as a check is already in progress
[2022-09-27T07:58:20,287][INFO ][o.e.h.AbstractHttpServerTransport] [node-2] publish_address {10.0.20.10:9201}, bound_addresses {[::]:9201}
[2022-09-27T07:58:20,288][INFO ][o.e.n.Node               ] [node-2] started {node-2}{H1mWOBmNQAifDqiTluuZfQ}{A2VYg-_PQpOyZzJQyR1t_Q}{node-2}{10.0.20.10}{10.0.20.10:9301}{dm}{xpack.installed=true}

 

올리면

 

이렇게 두개의 노드가 배치된 걸 볼수 있다.

 

 

head로도 확인 할수 있다.

 

 

token을 이용하여 등록하는 방법인데 보안설정을 enable해야해서 

나는 disable인 상태에서 하고 싶은데..ㅠㅠ

 

https://www.elastic.co/guide/en/elasticsearch/reference/current/add-elasticsearch-nodes.html

 

Add and remove nodes in your cluster | Elasticsearch Guide [8.4] | Elastic

Voting exclusions are only required when removing at least half of the master-eligible nodes from a cluster in a short time period. They are not required when removing master-ineligible nodes, nor are they required when removing fewer than half of the mast

www.elastic.co

 

 

cluster.initial_master_nodes 설정 방법

 

 

https://www.elastic.co/guide/en/elasticsearch/reference/7.17/important-settings.html#unicast.hosts

 

Important Elasticsearch configuration | Elasticsearch Guide [7.17] | Elastic

Don’t modify anything within the data directory or run processes that might interfere with its contents. If something other than Elasticsearch modifies the contents of the data directory, then Elasticsearch may fail, reporting corruption or other data in

www.elastic.co

 

 

인증서 이용하여 노드 추가하기

https://bidhankhatri.com.np/elk/add-remove-nodes-in-elasticsearch-cluster/

 

 

반응형

댓글