Se ha creado un Quórum ZooKeeper que consta de tres servidores ZooKeeper.
El zoo.cfgubicado en los tres servidores de ZooKeeper tiene el siguiente aspecto:
maxClientCnxns=50
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
dataDir=/var/lib/zookeeper
# the port at which the clients will connect
clientPort=2181
server.1=<ip-address-1>:2888:3888
server.2=<ip-address-2>:2888:3888
server.3=<ip-address-3>:2888:3888
Análisis
Está claro que uno de los tres servidores de ZooKeeper se convertirá en el Leadery los otros Followers. Si el Leaderservidor de ZooKeeper se ha apagado, las Leaderelecciones comenzarán nuevamente. El objetivo es verificar si otro servidor de ZooKeeper se convertirá en Leadersi el Leaderservidor se ha apagado.
Pregunta
¿Qué comando se debe emitir para verificar si un servidor ZooKeeper es un Líder o un Seguidor?

standaloneAlternativamente, se podría usar lo siguiente:
Imprimirá el modo en la salida:
fuente