Monitor ZooKeeper

[[email protected] scripts]$ cat zookeeper_mode.sh

#!/bin/bash

mode=`echo srvr|nc 127.0.0.1 2181| awk’/Mode/{print $2}’`

if [[ “$mode” == “follower” ]]; then

echo 1

elif [[ “$mode” == “leader” ]]; then

echo 2

else

echo 0

fi

[[email protected] scripts]$ ./zookeeper_mode.sh

2

[[email protected] scripts]$ cat zookeeper_status.sh

#!/bin/bash

zk=`echo ruok|nc 127.0.0.1 2181`

if [[ “$zk” == “imok” ]]; then

echo 1

else

echo 0

fi

[[email protected] scripts]$ echo ruok|nc 127.0.0.1 2181

imok[[email protected] scripts]$ ./zookeeper_status.sh

1

< /p>

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 4823 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.