NETWAYS / ansible-collection-elasticstack

A collection to install and manage the Elastic Stack
GNU General Public License v3.0
9 stars 8 forks source link

Remove initial master node after the first cluster initialize #137

Closed afeefghannam89 closed 1 year ago

afeefghannam89 commented 1 year ago

We should remove the cluster.initial_master_nodes after the first cluster initialize otherwise the node will lose data after the first restart. With if condition in the template elasticsearch.yml should we evaluate the cluster status, if it is already built, then do not set cluster.initial_master_nodes in the elasticsearch.yml file.

The roll out of the template should occur two times. One time before the first start of the cluster with notify on the task, because it will be the major config roll out. The first time after the Cluster initialize without notify on the task to not restart all cluster nodes at once. In the future, a restart will take place for any reason and Elasticsearch will read his configuration again.

widhalmt commented 1 year ago

We should either wait for #136 to be merged before starting with this or integrate the change in this PR. Before the merge we can't tell which nodes are masters and which aren't, but after the merge we know.