public void removeServerInstanceFromZooKeeper() throws Exception {
    setDeregisteredWithZooKeeper(true);

    if (znode != null) {
      znode.close();
      znode = null;
    }
    if (zooKeeperClient != null) {
      zooKeeperClient.close();
    }
    LOG.info("Server instance removed from ZooKeeper.");
  }
Adds a server instance to ZooKeeper as a znode.

@throws Exception
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/common/ZooKeeperHiveHelper.java