Hi Laxman,
  The servers takes care of all the issues with data integrity, so a kill
-9 is OK. Shutdown hooks are tricky. Also, the best way to make sure
everything works reliably is use kill -9 :).

Thanks
mahadev

On 7/12/11 11:16 PM, "Laxman" <lakshman...@huawei.com> wrote:

>When we stop zookeeper through zkServer.sh stop, we are aborting the
>zookeeper process using "kill -9".
>
> 
>
>129 stop)
>
>130     echo -n "Stopping zookeeper ... "
>
>131     if [ ! -f "$ZOOPIDFILE" ]
>
>132     then
>
>133       echo "error: could not find file $ZOOPIDFILE"
>
>134       exit 1
>
>135     else
>
>136       $KILL -9 $(cat "$ZOOPIDFILE")
>
>137       rm "$ZOOPIDFILE"
>
>138       echo STOPPED
>
>139       exit 0
>
>140     fi
>
>141     ;;
>
> 
>
> 
>
>This may corrupt the snapshot and transaction logs. Also, its not
>recommended to use "kill -9".
>
>In worst case, if latest snaps in all zookeeper nodes gets corrupted there
>is a chance of dataloss.
>
> 
>
>How about introducing a shutdown hook which will ensure zookeeper is
>shutdown gracefully when we call stop?
>
> 
>
>Note: This is just an observation and its not found in a test.
>
> 
>
>--
>
>Thanks,
>
>Laxman
>


Reply via email to