Questions tagged [kazoo]

Kazoo is a Python library designed to make working with Zookeeper a more hassle-free experience that is less prone to errors.

Kazoo is a Python library designed to make working with Zookeeper a more hassle-free experience that is less prone to errors.

42 questions
41
votes
6 answers

How to merge two json string in Python?

I recently started working with Python and I am trying to concatenate one of my JSON String with existing JSON String. I am also working with Zookeeper so I get the existing json string from zookeeper node as I am using Python kazoo library. # gets…
user2467545
11
votes
1 answer

How to use Python kazoo library?

I am planning to use Python kazoo library for Zookeeper. It's all about Python question here not zookeeper at all I guess meaning how to use Python kazoo properly.. I am totally new to python so I have no idea how to get going and how to use kazoo…
AKIWEB
  • 19,008
  • 67
  • 180
  • 294
10
votes
1 answer

How to use kazoo client for leader election?

This is the code mentioned on kazoo readthedocs election=zk.Election("/electionpath", "my-identifier") what are the input arguments to be passed to make particular node as leader? (i.e what does /electionpath and my-identifier refers here?)
shan
  • 121
  • 1
  • 6
10
votes
2 answers

Watches and Ephemeral node doesn't work when state of zookeeper changes automatically?

I have a very strange case with Python Kazoo library. What I am doing in my below code is - As soon as I connect to Zookeeper using kazoo library, I create an ephemeral node and then keep a watch on some other node and then I keep on running the…
arsenal
  • 23,366
  • 85
  • 225
  • 331
8
votes
2 answers

zookeeper lock stayed locked

I am using celery and zookeeper (kazoo lock) to lock my workers. I have a problem when I kill (-9) one of the workers before releasing the lock then that lock stays locked forever. So my question is: Does killing the process release locks in that…
Milan Kocic
  • 459
  • 6
  • 20
5
votes
2 answers

How to add children node data update watch in Python using kazoo package

I want to add watch on all children nodes of a node in Python using kazoo client but ChildrenWatch only watches for child add or remove not for data update of any child node. I am searching for a simple recipe which does this task. Sample code will…
Black_Rider
  • 1,465
  • 2
  • 16
  • 18
4
votes
1 answer

getting current leader of election recipe in kazoo

I am able to get current contenders using election.lock._get_sorted_children() and respective identifiers using election.lock.contenders(). But election.lock.contenders() also sorts the list, so will election.lock.contenders()[0] always be the…
Aditya
  • 5,509
  • 4
  • 31
  • 51
4
votes
2 answers

How to watch on descendant child nodes in Python using kazoo?

I recently started working with Python for Zookeeper. I am using kazoo library for Zookeeper. I have a very simple use case using kazoo for Zookeeper. I have a root node which is - /root. Now I need to keep a watch on the root node /root and if the…
arsenal
  • 23,366
  • 85
  • 225
  • 331
3
votes
0 answers

Is it possible to start an embedded zookeeper server instance for unit testing in python?

I'd like to create and destroy a zookeeper server when unit-testing as in this question. Is it possible to create an embedded in-memory server for example with kazoo?
Lorenzo Belli
  • 1,767
  • 4
  • 25
  • 46
3
votes
1 answer

Handle badarg in Erlang

I am very new to the Erlang and I am getting badarg error when I try to convert binary to string as shown below. Prefix = binary:bin_to_list(wh_json:get_ne_value(<<"prefix">>, Patterns)), where Patterns are: Pattern1-->…
Vinay Saini
  • 123
  • 2
  • 10
2
votes
1 answer

What all possible times 'kazoo.exceptions.ConnectionLoss' is raised?

I am using apache-zookeeper and kazoo framework for one of my requirement. I have a simple zookeeper cluster setup and few clients connecting to server cluster to read node information. I am facing kazoo.exceptions.ConnectionLoss randomly(once in…
Akshay
  • 1,231
  • 1
  • 19
  • 31
2
votes
1 answer

How to stop datawatch on zookeeper node using kazoo?

How to explicitly stop datawatch process started on a zNode using python module kazoo? Below is the way I created datawatch from kazoo.recipe.watchers import DataWatch datawatch = DataWatch(client=zookeeper_client, path=path_to_znode,…
Akshay
  • 1,231
  • 1
  • 19
  • 31
2
votes
1 answer

Zookeeper or Kafka connection Error, Showing Kazoo::VersionNotSupported Error

I am using Kafka and zookeeper, and creating connection between them but the connection is getting dropped again and again when I try to create new Kafka::Consumer ZOOKEEPER = '127.0.0.1:2181' CLIENT_ID = '************' TOPICS =…
Ravin Gupta
  • 783
  • 7
  • 13
2
votes
1 answer

Kazoo connect with chroot

I was wondering if there is a way in the kazoo library for zookeeper to create the chroot path in the connection string if the path doesn't already exist? Does anyone have experience with this? I've read the docs, but I haven't really found anything…
Juliuszc
  • 377
  • 2
  • 4
  • 16
2
votes
1 answer

How to represent byte json string in Python

I am working with Python and Zookeeper as I am using kazoo library in Python. This question is not about Zookeeper or kazoo library. I guess this is mainly related to Python. Below are my two variables - new_error_str = "Error occurred on machine…
user2467545
1
2 3