def setup_zk
      @zk = ZK.new(@zkservers) if @zkservers
      @zk.register(redis_nodes_path) { |event| handle_zk_event(event) }
      if @safe_mode
        @zk.on_expired_session { purge_clients }
      end
      @zk.on_connected { @zk.stat(redis_nodes_path, :watch => true) }
      @zk.stat(redis_nodes_path, :watch => true)
      update_znode_timestamp
    end
def setup_zk
      @zk = ZK.new(@zkservers) if @zkservers
      @zk.register(redis_nodes_path) { |event| handle_zk_event(event) }
      if @safe_mode
        @zk.on_expired_session { purge_clients }
      end
      @zk.on_connected { @zk.stat(redis_nodes_path, :watch => true) }
      @zk.stat(redis_nodes_path, :watch => true)
      update_znode_timestamp
    end
Sets up the underlying ZooKeeper connection.