how to have two nodes on localhost server elasticsearch -
i'm working on localhost, , in order understand cluster , node is, want have 2 nodes on localhost.
just make clear: when lunch elasticsearch bin/elasticsear, i'm luching cluster, right?
if yes, node?
and how can have 2 nodes on cluster?
update
you may ask why need that?
it because, may know, each index in elasticsearch cluster has shads. default 5 shards 1 index, , default each index has 1 replica, each index default has 10 shards, 5 original data, , 5 replica. in elasticsearch, it impossible put replica's shards , original shards on same node. thus, in case, have 1 cluster running 5 original shards each index, don't have 5 replica's shads. that's why index status yellow (not green, not red), want green, need node in cluster put shards, have 1 elasticsearch server (localhost), that's why need node on localhost elasticsearch server
whenever start elasticsearch server master node
gets default.in order run node, go terminal , start elastic-search server again. make sure that:
discovery.zen.ping.multicast.enabled: true
inelasticsearch.yml
.
since elasticsearch distributed
in nature, newly added instance automatically detected existing node(s).you can verify terminal.
suppose name of existing node node1
, newly added node node2
.
on terminal
node1
running see message:[node1] added [node2]
on terminal
node2
has been started see message:[node2] detected_master [node1]
both nodes detected each other automatically. can run following query in sense check nodes running:
get /_cluster/state
this list nodes
Comments
Post a Comment