How to verify a new node joins to the cluster properly after deployment

Say, in a ElasticSearch cluster, we have ElasticSearch Master, Client, Tribe nodes running on the same machine, while ElasticSearch Data and Client nodes are running on another machine. And the deployment could bring down either of them->deploy->bring back the machine and then get to the other one.

Now I want to write a validation script to run after the deployment, it will be a bash script. Is there a easy way to perform this?


Look at _cat/nodes?

Thanks for replying

That is my current solution too. I am thinking of parsing the _cat/nodes and check whether the current hostname is there. But the challenging part is when the current machine/nodes is on, before it find and join the main cluster, it will think itself is the only one(cluster) here and return me with the nodes that has the current hostname.

So I need to parse and check whether it can find its siblings which is pretty wield as they are not suppose to know each other, right. Are there better ways?