当前位置:网站首页>ZK has a node reporting it is possible not running and the log has no obvious error

ZK has a node reporting it is possible not running and the log has no obvious error

2022-06-23 04:56:00 ximi_ xuexi

In a problem investigation , The discovery application is partly about zk Log error of . And in view zk In the state of , An error is found on one node It is probably not running.

1、 Use ./zkServer.sh status View all zk The state of the node .

./zkServer.sh status The normal return of this instruction should be leader Or is it follower.

2、 It is found that except for one error reporting node , All other nodes return the status as follower.

The error information of the error reporting node is as follows :

It is probably not running

3、 Log check

After carefully checking the log , Find out zk No obvious error

4、 It is found that there is a configuration problem

stay zk Configuration of zoo.cfg in , There is a configuration :leaderServes=no( The default is yes)

Let's see leaderServes Significance of configuration :

leader Whether the service accepts client connections , Default yes.

Higher update throughput can be increased at the expense of read throughput , You can set no.

The node is larger than 3 It is recommended to close... After hours .

In this way, we can clearly know , Is due to leaderServes Configured for no, Lead to leader The node no longer accepts client connections , As a result, the command-line tool cannot connect to zk, appear It is probably not running Report errors .

5、 Modify configuration test

Modify the configuration :

leaderServes=yes

Restart zk, Then you can find ./zkServer.sh status Inquire about zk state ,leader The node returns to normal .

原网站

版权声明
本文为[ximi_ xuexi]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/174/202206222349001737.html