Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zookeeper - monitoring leader when leaderServes=no

I recently scaled out a zookeeper cluster, and as part of the configuration change, we set

leaderServes=no

in order to increase throughput. This has worked out great, except for one problem: the leader no longer responds to (most) four letter words, replying to any inquiries with the message

This ZooKeeper instance is not currently serving requests

I get it dear leader, you're not doing the menial work anymore, but ... could the monitoring software still get your status and metrics?

I really hope there's a work around that isn't "use JMX". Any help much appreciated!

like image 483
Danielle M. Avatar asked Feb 21 '17 18:02

Danielle M.


1 Answers

No , it cann't . This is what leaderServes=no functions , the leader refuses all the client commands .

//org.apache.zookeeper.server.quorum.Leader#lead
if (!System.getProperty("zookeeper.leaderServes", "yes").equals("no")) {
   self.cnxnFactory.setZooKeeperServer(zk);
 }
like image 181
shaoyihe Avatar answered Oct 22 '22 03:10

shaoyihe