Questions tagged [apache-curator]

Use this tag for questions about using Apache Curator. Curator is a set of Java libraries that makes using Apache ZooKeeper much easier.

Apache Curator is a Java/JVM client library for Apache ZooKeeper, a distributed coordination service. It includes a highlevel API framework and utilities to make using Apache ZooKeeper much easier and more reliable. It also includes recipes for common use cases and extensions such as service discovery and a Java 8 asynchronous DSL.

Curator has become the de-facto ZooKeeper client on the JVM and is used by a variety of other software projects including Apache Storm and Apache Spark and by a wide range of companies from Facebook to Netflix to Ebay.

Links

254 questions
22
votes
1 answer

How do I check if a path exists in Zookeeper using Curator?

I'm currently in the early stages of development to integrate Zookeeper stuff into my app. I'm using Netflix's Curator as an API for dealing with Zookeeper. I get the gist of most of it (like adding ZNodes and whatnot). But how the heck do you check…
Cody S
  • 4,744
  • 8
  • 33
  • 64
21
votes
6 answers

Apache Curator Unimplemented Errors When Trying to Create zNodes

I'm attempting to use Apache Curator with a dockerized zookeeper instance and no matter how I attempt to connect I always end up with a org.apache.zookeeper.KeeperException$UnimplementedException: KeeperErrorCode = Unimplemented for... error.…
snerd
  • 1,238
  • 1
  • 14
  • 28
19
votes
2 answers

Using ACL with Curator

Using CuratorFramework, could someone explain how I can: Create a new path Set data for this path Get this path Using username foo and password bar? Those that don't know this user/pass would not be able to do anything. I don't care about SSL or…
Molten Ice
  • 2,715
  • 1
  • 27
  • 37
19
votes
5 answers

How to implement distributed rate limiter?

Let's say, I have P processes running some business logic on N physical machines. These processes call some web service S, say. I want to ensure that not more than X calls are made to the service S per second by all the P processes combined. How can…
16
votes
2 answers

What does an Apache Curator "connection string" look like?

How does the connection string given to CuratorFrameworkFactory#newClient look like? So far I haven't found any information on the web and the JavaDoc doesn't tell me the correct format.
Ztyx
  • 14,100
  • 15
  • 78
  • 114
14
votes
2 answers

LeaderLatch vs LeaderSelector

what is the difference between LeaderLatch and LeaderSelector in the apache curator framework? http://curator.incubator.apache.org/curator-recipes/leader-election.html
user2474033
  • 155
  • 1
  • 5
12
votes
1 answer

How to avoid double connection close upon regaining connectivity?

Under these circumstances: The client loses network connectivity to zk. One minute passes. The client regains network connectivity to zk. I'm getting the following panic: panic: close of closed channel goroutine 2849…
lf215
  • 1,185
  • 7
  • 41
  • 83
12
votes
1 answer

How to handle Apache Curator Distributed Lock loss of connection

Say I have two distributed process running the following code that uses zookeeper and curator for a shared lock: public static void main(String[] args) throws Exception { CuratorFramework client =…
11
votes
4 answers

How to use LeaderElection recipe efficiently using Curator for Zookeeper?

I am using Apache Curator library for doing leadership election on the Zookeeper. I have my application code deployed in various machines and I need to execute my code from one machine only so that's why I am doing leadership election on the…
john
  • 11,311
  • 40
  • 131
  • 251
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

Apache Zookeeper / Curator time-to-live on locks

Is there any facility in the Apache Curator lock recipes (or lower-level ZooKeeper) for auto-releasing locks that have exceeded some TTL? If not, is there a best practice for dealing with that? I see that Curator automatically releases locks in…
Scott Feinstein
  • 159
  • 1
  • 6
9
votes
2 answers

How to watch for events on the descendant nodes in ZooKeeper using curator?

I am working on a project in which I need to maintain a watches on a node, and that nodes children as well. I have tried using PathCache but I am not sure how to watch for childrens children here? Here my root node is - "/my/test" and I am keeping a…
AKIWEB
  • 19,008
  • 67
  • 180
  • 294
8
votes
1 answer

ZooKeeper Recipes and Apache Curator

I am trying to understand exactly what types of problems Apache ZooKeeper ("ZK") solves, and perhaps their Recipes page is the best place to start. First off, I am making the following assumptions: The ZooKeeper API (available in both Java and C)…
DirtyMikeAndTheBoys
  • 1,077
  • 3
  • 15
  • 29
8
votes
0 answers

Curator - InterProcessMutex lock does not delete nodes

Does anybody know which of the Curator lock recipes creates ephemeral nodes ? I tested InterProcessMutex lock but as far as I can see (with the zkClient) it does not delete the nodes after release or close the session. This is the code I'm using for…
Jose
  • 81
  • 2
7
votes
2 answers

Getting KafkaConsumer is not safe for multi-threaded access error when I use CuratorFrameworkFactory.newClient()

I am receiving this error below: java.util.ConcurrentModificationException: KafkaConsumer is not safe for multi-threaded access when I include this in my code: CuratorFrameworkFactory.newClient() I don't understand what's causing the error. Any…
edrichhans
  • 113
  • 1
  • 2
  • 11
1
2 3
16 17