Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Curator Background operation retry gave up

My code is like this:

String zkAddress = "...";  // example
ExponentialBackoffRetry retryPolicy = new ExponentialBackoffRetry(1000, 3);
CuratorFramework client = CuratorFrameworkFactory.builder()
                    .connectString(zkAddress)
                    .retryPolicy(retryPolicy)
                    .build();
client.start();

The curator-framework version is 3.1.0. I got an error listed below.

18:31:20.839 [Curator-Framework-0] ERROR org.apache.curator.framework.imps.CuratorFrameworkImpl - Background operation retry gave up
org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:99) ~[zookeeper-3.5.1-alpha.jar:3.5.1-alpha-1693007]
    at org.apache.curator.framework.imps.CuratorFrameworkImpl.checkBackgroundRetry(CuratorFrameworkImpl.java:802) [curator-framework-3.1.0.jar:?]
    at org.apache.curator.framework.imps.CuratorFrameworkImpl.performBackgroundOperation(CuratorFrameworkImpl.java:931) [curator-framework-3.1.0.jar:?]
    at org.apache.curator.framework.imps.CuratorFrameworkImpl.backgroundOperationsLoop(CuratorFrameworkImpl.java:883) [curator-framework-3.1.0.jar:?]
    at org.apache.curator.framework.imps.CuratorFrameworkImpl.access$300(CuratorFrameworkImpl.java:69) [curator-framework-3.1.0.jar:?]
    at org.apache.curator.framework.imps.CuratorFrameworkImpl$4.call(CuratorFrameworkImpl.java:310) [curator-framework-3.1.0.jar:?]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_77]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_77]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:1.8.0_77]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_77]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_77]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_77]
like image 700
formath Avatar asked Oct 23 '25 03:10

formath


1 Answers

The error is resulted from that machine has no authority to access the zookeeper server. I have change to another machine and it works right.

like image 139
formath Avatar answered Oct 27 '25 05:10

formath



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!