Alternative: Check at host level
edit
IMPORTANT: This documentation is no longer updated. Refer to Elastic's version policy and the latest documentation.
Alternative: Check at host level
editIf the inline shell script command doesn’t work, you can run the check directly from the director host. This can happen for example when your user lacks permissions to access Docker. This approach avoids entering the container and doesn’t require installing additional tools like telnet or nc, relying instead on curl, which is typically available by default on most Linux systems.
-
Run the equivalent inline shell script directly on the host terminal, outside of the zookeeper container
for i in $(seq 2191 2199); do output=$(echo mntr | curl -s telnet://localhost:$i | grep -E "server_state|leader|follower|not currently serving|zk_znode_count"); if [ -n "$output" ]; then echo "ZK mntr Response from port $i:"; echo "$output"; break; fi done -
Look for the following lines in the output:
-
zk_server_state leaderorzk_server_state follower— indicates the node’s ZooKeeper role
-