zk切换

配置文件

cat /etc/zookeeper/conf/zoo.cfg 

监控主备

while :;do  echo -n  "                                  ";date; for i in hdp1 hdp2 hdp3 bjc-hdp4 bjc-hdp5 ;do  echo -n "$i:"; echo mntr|nc $i 2181|grep zk_server_state;done;sleep 1;done

 

leader挂了日志

2023-12-17 16:17:38,327 - INFO  [QuorumPeer[myid=4]/0.0.0.0:2181:FastLeaderElection@815] - New election. My id =  4, proposed zxid=0x1000000009

zk成为主后日志显示

2023-12-17 16:19:34,709 - INFO  [QuorumPeer[myid=4]/0.0.0.0:2181:Leader@358] - LEADING - LEADER ELECTION TOOK - 1154

posted on 2023-12-17 16:29  寒星12345678999  阅读(7)  评论(1编辑  收藏  举报