How can i make data node as master

i have created a cluster with 1 master and 3 data node . if my master is down i what to make data node as a master

will this work ?
node.master: true true

Yes, but I'm pretty sure you don't want to make this change after the master has gone down. At that point the data nodes have no knowledge of the cluster state and I suspect that turning one of them into a master might cause data loss.

Given that you'll want to have at least three master-eligible nodes (you obviously need more than one to avoid a single point of failure and you need more than two to avoid split brain situations) I suggest that you make all nodes of your small cluster master-eligible.

1 Like

As Magnus points out the key is to have at least 3 master eligible nodes so that another can step in when one fails. When changing this, make sure to update the minimum_master_nodes setting in the elasticsearch.yml config files in order to avoid split brain scenarios. If you make all 4 of your nodes master eligible, this should be set to 3.