Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Zookeeper >> mail # user >> Healthcheck using the stat command

Copy link to this message
Re: Healthcheck using the stat command
The problem with 'ruok' is that it doesn't tell you the state of the
Instance. 'ruok' might return 'imok' but the instance might not be serving
due to some other error. Only a 'stat' will tell you that.


On 1/23/12 1:51 PM, "Philip Smith" <[EMAIL PROTECTED]> wrote:

>There is a batch java program that does a health check:
>which basically runs the ruok command. You could run the stat command and
>parse out the response but I think 99% of what you want could be simply
>looking for 'imok' in the response to the ruok command.
>philip_smith@st11p00td-devlog001:~ 2 $ alias zkok
>alias zkok='for idx in 1 2 3 4 5 ; do export
>zkserver="st11p00td-zookeeper00${idx}" ; echo "$zkserver $( echo ruok |
>nc  $zkserver 2181 )" ; done'
>philip_smith@st11p00td-devlog001:~ 3 $ zkok
>st11p00td-zookeeper001 imok
>st11p00td-zookeeper002 imok
>st11p00td-zookeeper003 imok
>st11p00td-zookeeper004 imok
>st11p00td-zookeeper005 imok
>philip_smith@st11p00td-devlog001:~ 4 $
>On Jan 23, 2012, at 1:45 PM, Natarajan Suresh wrote:
>> I am trying to write a small health check script for the zookeeper
>>instances. The "stat" command gives me an output like this:
>> ===========================Zookeeper version: 3.3.3-1073969, built on
>>02/23/2011 22:27 GMTClients:
>> Latency min/avg/max: 0/0/35Received: 1113675Sent: 1113706Outstanding:
>>0Zxid: 0x2000e2925Mode: followerNode count: 71==========================>> How do I know that the server is ok ? I do not have a bad instance with
>>me to checkout what the output will be in that case.
>> If anyone has already written a health check script, can you please
>>share with me ?
>> Thanks
>> |Suresh|
>Regards, Philip
>Philip Smith
>Senior Software Engineer
>408 862-1360 office
>530 574-1659 mobile