if (zoo.exists(monitorPath)) {
byte[] data = zoo.getData(monitorPath, null);
// If the node isn't empty, it's from a previous install (has hostname:port for HTTP server)
if (0 != data.length) {
// Recursively delete from that parent node
zoo.recursiveDelete(monitorPath, NodeMissingPolicy.SKIP);
// And then make the nodes that we expect for the incoming ephemeral nodes
zoo.putPersistentData(monitorPath, new byte[0], NodeExistsPolicy.FAIL);
zoo.putPersistentData(monitorLockPath, new byte[0], NodeExistsPolicy.FAIL);
} else if (!zoo.exists(monitorLockPath)) {