rp346
rp346

Reputation: 7038

How to keep kazoo connected to zookeeper?

I am trying to use Zookeeper to manager distributed cluster in sync.

Right now I am using ec2 spot instances and I want each ec2 spot instance to connect & create znode on zookeeper with some metadata like instance id, private hostname, instance type.

So far I am manage to make each spot instance to create znode on zookeeper with respective metadata. but I want to make it such a way that when the instance(spot instance) is taken away then that znode to be disappear itself.

Or is there any better way to do this ?

Upvotes: 0

Views: 527

Answers (1)

Dirk
Dirk

Reputation: 456

use the ephemeral nodes of zookeeper. For kazzoo just use the create with the ephemeral parameter set:

client.create(path, ephemeral=True)

But keep in mind, that you can't create nodes underneath a ephemeral node.

Upvotes: 1

Related Questions