org.apache.zookeeper.KeeperException$OperationTimeoutException: KeeperErrorCode = OperationTimeout 报错

新同事本地启项目,springboot启动报这个错,原文如下:

2021-12-10.14:35:02.202 restartedMain INFO ZooKeeper : Client environment:java.io.tmpdir=C:\Users\ADMINI~1\AppData\Local\Temp\
2021-12-10.14:35:02.202 restartedMain INFO ZooKeeper : Client environment:java.compiler=<NA>
2021-12-10.14:35:02.202 restartedMain INFO ZooKeeper : Client environment:os.name=Windows 10
2021-12-10.14:35:02.202 restartedMain INFO ZooKeeper : Client environment:os.arch=amd64
2021-12-10.14:35:02.202 restartedMain INFO ZooKeeper : Client environment:os.version=10.0
2021-12-10.14:35:02.202 restartedMain INFO ZooKeeper : Client environment:user.name=Administrator
2021-12-10.14:35:02.202 restartedMain INFO ZooKeeper : Client environment:user.home=C:\Users\Administrator
2021-12-10.14:35:02.202 restartedMain INFO ZooKeeper : Client environment:user.dir=D:\WorkSpace\league-api
2021-12-10.14:35:02.203 restartedMain INFO ZooKeeper : Initiating client connection, connectString=test-zk01-a.zk.xxx.com:2181 sessionTimeout=600000 watcher=org.apache.curator.ConnectionState@43224f71
2021-12-10.14:35:12.584 Curator-Framework-0 INFO CuratorFrameworkImpl : backgroundOperationsLoop exiting
2021-12-10.14:35:13.651 restartedMain-SendThread(10.20.0.12:2181) INFO ClientCnxn : Opening socket connection to server 10.20.0.12/10.20.0.12:2181. Will not attempt to authenticate using SASL (unknown error)
2021-12-10.14:35:13.677 restartedMain-SendThread(10.20.0.12:2181) INFO ClientCnxn : Socket connection established to 10.20.0.12/10.20.0.12:2181, initiating session
2021-12-10.14:35:14.131 restartedMain-SendThread(10.20.0.12:2181) INFO ClientCnxn : Session establishment complete on server 10.20.0.12/10.20.0.12:2181, sessionid = 0x17af8b923322751, negotiated timeout = 40000
2021-12-10.14:35:14.185 restartedMain INFO ZooKeeper : Session: 0x17af8b923322751 closed
2021-12-10.14:35:14.185 restartedMain-EventThread INFO ClientCnxn : EventThread shut down for session: 0x17af8b923322751
2021-12-10.14:35:14.206 restartedMain WARN AnnotationConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'elasticJobAutoConfiguration': Invocation of init method failed; nested exception is com.dangdang.ddframe.job.reg.exception.RegException: org.apache.zookeeper.KeeperException$OperationTimeoutException: KeeperErrorCode = OperationTimeout
2021-12-10.14:35:14.208 restartedMain INFO StandardService : Stopping service [Tomcat]
2021-12-10.14:35:14.287 restartedMain INFO ConditionEvaluationReportLoggingListener :Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-12-10.14:35:14.491 restartedMain ERROR SpringApplication : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'elasticJobAutoConfiguration': Invocation of init method failed; nested exception is com.dangdang.ddframe.job.reg.exception.RegException: org.apache.zookeeper.KeeperException$OperationTimeoutException: KeeperErrorCode = OperationTimeout
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:160)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:440)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:944)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:730)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:412)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:302)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1290)
at com.yueche.league.LeagueApiApplication.main(LeagueApiApplication.java:8)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: com.dangdang.ddframe.job.reg.exception.RegException: org.apache.zookeeper.KeeperException$OperationTimeoutException: KeeperErrorCode = OperationTimeout
at com.dangdang.ddframe.job.reg.exception.RegExceptionHandler.handleException(RegExceptionHandler.java:52)
at com.dangdang.ddframe.job.reg.zookeeper.ZookeeperRegistryCenter.init(ZookeeperRegistryCenter.java:107)
at com.yueche.league.common.job.ElasticJobAutoConfiguration.initElasticJob(ElasticJobAutoConfiguration.java:40)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:389)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:333)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:157)
... 23 common frames omitted
Caused by: org.apache.zookeeper.KeeperException$OperationTimeoutException: KeeperErrorCode = OperationTimeout
at com.dangdang.ddframe.job.reg.zookeeper.ZookeeperRegistryCenter.init(ZookeeperRegistryCenter.java:102)
... 31 common frames omittedProcess finished with exit code 0

排查过程:
网上有说防火墙的(试了不行);有说zk版本的(这边还是第三方包间接依赖的,且有包冲突,试了去掉一个没好使);

解决方案:
修改了超时时间

ZookeeperConfiguration zookeeperConfiguration = new ZookeeperConfiguration(serverList, namespace);
zookeeperConfiguration.setSessionTimeoutMilliseconds(600000);
zookeeperConfiguration.setConnectionTimeoutMilliseconds(600000);
zookeeperConfiguration.setMaxSleepTimeMilliseconds(30000);
zookeeperConfiguration.setBaseSleepTimeMilliseconds(10000);
ZookeeperRegistryCenter regCenter = new ZookeeperRegistryCenter(zookeeperConfiguration);

本地启动OK

原文链接

【转载】elastic-job链接zookeeper报错KeeperErrorCode = OperationTimeout相关推荐

  1. zookeeper 链接报错 KeeperErrorCode = NodeExists for

    zookeeper 链接报错 KeeperErrorCode = NodeExists for zookeeper  链接报错 要将原来的删除掉 dataDir路径下的version-2文件夹,再重启 ...

  2. 当zookeeper报错Invalid config, exiting abnormally,Error contacting service. It is probably not running

    配置版本 zookeeper-3.4.6 hadoop-2.7.7 jdk1.8/jdk8 centos7 当你启动zookeeper报错可以先试以下方法 或者Error contacting ser ...

  3. Navicat链接数据库报错1130解决方案

    Navicat链接数据库报错1130解决方案 参考文章: (1)Navicat链接数据库报错1130解决方案 (2)https://www.cnblogs.com/newAndHui/p/113451 ...

  4. php7链接数据库报错The server requested authentication method unknown to the client

    php7链接数据库报错The server requested authentication method unknown to the client 主要原因 是因为 mysql 8.0 升级了密码 ...

  5. zookeeper报错 JAVA_HOME is not set

    zookeeper报错 JAVA_HOME is not set 很多开发者安装zookeeper的时候,应该会发现到这么一个问题: JAVA_HOME is not set 好的!那么这个是什么意思 ...

  6. nacos启动报错 Unable to start embedded Tomcat 以及项目链接nacos报错 server is DOWN now, please try again later!

    一 Unable to start embedded Tomca nacos启动报错如下,原因是没有以单机模式启动. 解决方式 修改nacos启动文件 startup.cmd中下列参数. set MO ...

  7. Thonny链接pico报错Device is busy or does not respond. Your options: wait until it completes current work

    Thonny链接pico报错之 Device is busy or does not respond. Your options: wait until it completes current wo ...

  8. idea启动项目zookeeper报错

    idea启动时zookeeper报错java.lang.IllegalArgumentException: Unable to canonicalize address 172.22.8.9/:218 ...

  9. Zookeeper报错Will not attempt to authenticate using SASL解决办法

    Will not attempt to authenticate using SASL (unknown error) 经过查资料,这个问题与zookeeper里面的zoo.cfg配置有关. 在程序填 ...

最新文章

  1. linux驱动:TI+DM8127+GPIO(三)之omap_hwmod中添加GPIO资源
  2. Mysql 通过frmibd 恢复数据
  3. java ui设计用什么_UI设计是什么?UI怎么设计?
  4. [图解]小白都能看懂的FASTER R-CNN – 原理和实现细节
  5. Sentry异常监控方案部署-前端攻略
  6. Android—打包aar以及module依赖操作
  7. 高等数学上-赵立军-北京大学出版社-题解-练习5.5
  8. 你知道面试官是如何刷人的吗
  9. 投票抵制华为鸿蒙系统,网友投票华为十大技术:鸿蒙OS仅排第二!
  10. elasticsearch-1.7.1 集群搭建
  11. windows 2008 64 bit英文语言包 下载地址
  12. Python-语句结构
  13. LanguageTool精简的两个思路
  14. 大数据私房菜--Hadoop完全分布式安装
  15. LeetCode-整形数组组合最大数
  16. LTE ue连接enb数据包流程解析
  17. 《中国企业家》杂志:柳传志走访旧金山
  18. 安卓APP按键美化——圆角按键
  19. mysql 月度账单汇总_MySQL按年度、季度、月度、周、日SQL统计查询
  20. 程序员避免中年危机的2个方向

热门文章

  1. 二、组件协作类设计模式
  2. vscode头部注释
  3. 实战五:基于Pima印第安人数据——Model_ensemble-example
  4. 前端性能优化的方式有哪些?
  5. java单精度浮点_Java 浮点数的范围和精度
  6. 电源纹波很大?如何用示波器测试到最准确的电源纹波
  7. cmd格式化(重置)磁盘/U盘的方法
  8. OpenCV边缘检测
  9. 后端开发学习阶段总结
  10. HAProxy提供高可用性、负载均衡以及基于TCP和HTTP应用的代 理,HAProxy支持数以万计并发连接