Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

  1. 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?

  2. 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?

  3. When setting up a quorum, is there a best practice to generate the myid files? So each node will self-discover its id?

share|improve this question

migrated from stackoverflow.com Apr 20 '11 at 14:28

This question came from our site for professional and enthusiast programmers.

1 Answer 1

up vote 1 down vote accepted

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.

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.