We have five node cluster running in production with 3 zookeepers - all are VMs. We have to restart the cluster often for some hardware patching.
We have written an ans
From the Java API, you can use AdminClient#describeCluster, which can return you the list of nodes in the cluster currently known to the Controller.
Also, do not do broker rolling restarts like that. You should first identify which is the Contoller, then shut that down last.