python - What is the command in zookeeper to make a zookeeper leader voluntarily into a follower in a cluster? -


i have 4 questions regarding zoo-keeper. please give inputs on regard.

  1. what command in zookeeper make leader voluntarily follower inside cluster,which in-turn make follower machine in cluster takeover leader?

  2. what procedure followed zookeeper election form leader inside cluster?

  3. what command check cluster status in zookeeper, in turn can that, there command in zookeeper cluster status zoo-keeper healthy , cluster formed zookeeper?

question 1) zookeeper leader stepdown - question, other shutting leader down , brining i'm not of command that.

question 2) leader election: discussion of here:

leader activation leader activation includes leader election. have 2 leader election algorithms in zookeeper: leaderelection , fastleaderelection (authfastleaderelection variant of fastleaderelection uses udp , allows servers perform simple form of authentication avoid ip spoofing). zookeeper messaging doesn't care exact method of electing leader has long following holds:

the leader has seen highest zxid of followers. quorum of servers have committed following leader. of these 2 requirements first, highest zxid amoung followers needs hold correct operation. second requirement, quorum of followers, needs hold high probability. going recheck second requirement, if failure happens during or after leader election , quorum lost, recover abandoning leader activation , running election.

after leader election single server designated leader , start waiting followers connect. rest of servers try connect leader. leader sync followers sending proposals missing, or if follower missing many proposals, send full snapshot of state follower.

http://zookeeper.apache.org/doc/r3.3.2/zookeeperinternals.html#sc_leaderelection

question 3) checking cluster status - can try issuing 1 of 4 letter commands @ client port, this:

echo ruok | nc 127.0.0.1 5111 

which respond imok if well.

full list of commands here: http://zookeeper.apache.org/doc/r3.3.1/zookeeperadmin.html#sc_zkcommands

or run jmx: http://zookeeper.apache.org/doc/r3.3.1/zookeeperjmx.html


Comments

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -