0

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 ?

Zulu
  • 8,765
  • 9
  • 49
  • 56
roy
  • 6,344
  • 24
  • 92
  • 174

1 Answers1

1

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.

Dirk
  • 436
  • 2
  • 15