Unable to remove Root Node

I have 2 nodes cluster, both are mastered enabled.
node-1

cluster.name: test
node.name: "node-1"
node.master: true
node.data: true
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
http.port: 8200
network.host: ["localhost","ip1"]
transport.tcp.port: 8300
discovery.zen.ping.unicast.hosts: ["ip1","ip2"]
discovery.zen.minimum_master_nodes: 1
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.client_authentication: required
xpack.security.transport.ssl.keystore.path: elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: elastic-certificates.p12

node-1

cluster.name: test
node.name: "node-2"
node.master: true
node.data: true
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
http.port: 8200
network.host: ["localhost","ip2"]
transport.tcp.port: 8300
discovery.zen.ping.unicast.hosts: ["ip1","ip2"]
discovery.zen.minimum_master_nodes: 1
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.client_authentication: required
xpack.security.transport.ssl.keystore.path: elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: elastic-certificates.p12

Everything is working fine and perfectly.
Note : I have created .p12 certificate and pass in node-1 (bin/Elasticsearch-setup-passwords interactive). and shards are available on both nodes

Now I want to remove node-1. So If I stop node 1, node-2 has the following errors.
master_not_discovered_exception
or
cluster_block_exception
or
unable to authenticate issue.

Can anyone pls help? How Can I remove node-1 safely?

As described in the documentation you need at least 3 masdter eligible nodes in order to create a highly available cluster that can continue operating even if one of the nodes is lost. With only 2 master eligible nodes in the cluster the loss of one node will prevent a master from being elected and cause the remaining node to no longer accept writes.

If you want to permanently remove one node and keep the remaining one as a single node cluster I suspect you may need to use the elasticsearch-node tool, but I will not be able to guide on this as I have not used this myself.

That's not the case. The elasticsearch-node tool is very dangerous and should always be avoided. The manual describes how to remove master-eligible nodes and covers the case when you want to remove half or more of them.

1 Like

Thanks for your kind reply.
I tried with 5 nodes before, where 4 are mastered. Still, If I remove the root node (where I created pass&cert), other nodes have the same issue...
master_not_discovered_exception
or
cluster_block_exception
or
unable to authenticate issue.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.