I want to use zookeeper in my cluster. I have a few questions I did not yet find answers in the documents.
I want to have a management node in the cluster where the main zookeeper resides, and then have zookeeper on some nodes of the cluster, as failover.
What is the best practice for nodes to get the URL of the management node? I can't hardcode this since there can be serveral instances of the cluster in the data center (so a dns name is no good). In other words, is there a discovery mechanism?
When the management node crashes, how will the client nodes know to contact the failover nodes? Should they be able to read the same configuration file to know what are the servers in the quorum?
When setting up a quorum, is there a best practice to generate the myid files? So each node will self-discover its id?
That isn't how zookeeper works. You set up N zookeeper servers in a cluster, each server is equal, and each server can be the leader of the cluster at any time. When a leader crashes, another server will take over leadership automatically. There isn't one main zookeeper node.
1) There is no such thing as a management node in zookeeper. Each zookeeper server node can potentially be the leader of the quorum.
2) You configure clients with the host:port of all zookeeper servers in the cluster. If the server that a client is talking to goes down, the client will re-connect to another server.
3) I'm not sure what you mean by this. Each server has a myid file which has an integer in it. Just assign ids yourself, 1,2,3...
You can get more information here