【转载】elastic-job链接zookeeper报错KeeperErrorCode = OperationTimeout

这篇具有很好参考价值的文章主要介绍了【转载】elastic-job链接zookeeper报错KeeperErrorCode = OperationTimeout。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

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 omitted

Process 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

原文链接文章来源地址https://www.toymoban.com/news/detail-523916.html

到了这里,关于【转载】elastic-job链接zookeeper报错KeeperErrorCode = OperationTimeout的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 分布式调度引擎elastic-job3源码分析(六)-失效转移

      调度引擎是关键的基础设施,不但是定时执行任务,更是大规模分布式任务引擎,分布式并行处理平台,管理计算节点集群,提供高吞吐的可伸缩的数据处理能力。 公司日益增长的业务,对调度引擎高吞吐,高并发的要求也快速增长,需构建一个无中心,管理大集群,健壮

    2023年04月08日
    浏览(56)
  • 定时任务特辑 | Quartz、xxl-job、elastic-job、Cron四个定时任务框架对比,和Spring Boot集成实战

    专栏集锦,大佬们可以收藏以备不时之需: Spring Cloud 专栏: Python 专栏: Redis 专栏: TensorFlow 专栏: Logback 专栏: 量子计算: 量子计算 | 解密著名量子算法Shor算法和Grover算法 AI机器学习实战: AI机器学习实战 | 使用 Python 和 scikit-learn 库进行情感分析 AI机器学习 | 基于lib

    2024年02月05日
    浏览(44)
  • ZooKeeper创建节点报错:KeeperErrorCode = ConnectionLoss for

    ZooKeeper在创建节点时报错: 解决办法: 观察idea和集群的jdk版本是否一致。 集群jdk为 Java 1.8 idea下jdk为Java 12 调整idea下jdk版本 1.File - Project Structure 由于jdk向下兼容,因此Project下的SDK无需修改,仅调整Modules版本即可 2.File - Settings - Build, Execution, Deployment - Complier - Java Complier 完

    2024年02月06日
    浏览(27)
  • elastic-job-ui在使用druid作为数据库连接池时作业维度报错

    我们项目中使用到了elastic-job,然后自己封装了个sdk,方便使用,里面的数据源配置是常用的druid+mysql的组合,在操作中,发现elastic-job-ui可视化控制台会报错无法使用。 深究其原因是因为,各个服务把定时任务注册到了zk中,包括数据库配置类的一些信息,但是elastic-job-ui源

    2024年02月10日
    浏览(33)
  • 解决org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for

    今天初学zookeeper遇到了下列错误: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /zhiHu(连接丢失) 出错原因:设置的会话时间(sessionTimeout)太小了!!! 解决办法: 还有可能是因为没关防火墙,需要查看以下防火墙状态

    2024年02月09日
    浏览(26)
  • Hbase解决ERROR: KeeperErrorCode = ConnectionLoss for /hbase/master报错

    1、在单机模式中,要先修改一个文件:/usr/local/hbase/conf/hbase-site.xml hbase-site.xml内容: 保存运行 报错 报错原因:可能是因为之前启动过hadoop,然后里面/usr/local/hbase/hbase-tmp有hbase.id不一致的原因导致的 解决办法:将之前的hbase-site.xml的内容修改为 成功运行 hbase基础命令

    2024年02月09日
    浏览(32)
  • 放一个Supershell的github下载链接在这里,方便大家用(文章转载自雨苁)

    Supershell是一个通过WEB服务访问的C2远控平台,通过建立反向SSH隧道,获取完全交互式Shell,支持多平台架构Payload. Supershell是一个集成了reverse_ssh服务的WEB管理平台,使用docker一键部署,支持团队协作进行C2远程控制,通过在目标主机上建立反向SSH隧道, 获取真正的完全交互式

    2024年02月19日
    浏览(29)
  • 报错:torch.distributed.elastic.multiprocessing.errors.ChildFailedError:

    错误: torch.distributed.elastic.multiprocessing.errors.ChildFailedError: 这个主要是torch的gpu版本和cuda不适配 我的nvcc -V是11.8 torch使用的: 但是我发现下这个也不行,就降低了一个小版本,但还是cu118 就OK了 Previous PyTorch Versions | PyTorch  附个地址,可以去寻找对应的gpu版本torch !一定要c

    2024年04月17日
    浏览(26)
  • elastic报错java.lang.NoSuchFieldError: INDEX_CONTENT_TYPE

    升级框架版本后spring-data-elasticsearch repository操作报错 原因是springboot版本和spring-data-elasticsearch版本不对应 springboot:2.6.7 spring-data-elasticsearch:4.4.0 将spring-data-elasticsearch版本降低到4.3.4就好了 怎么荔枝

    2024年02月11日
    浏览(30)
  • deepspeed训练报错torch.distributed.elastic.multiprocessing.errors.ChildFailedError

    测试场景:使用deepspeed框架训练gpt模型 问题: 报错torch.distributed.elastic.multiprocessing.errors.ChildFailedError 具体见截图: 解决办法: 含义:表明在运行 train.py 脚本时,传递了一个未被识别的参数 --local-rank=1 这里我在train.py脚本文件中果然没有找到–local-rank参数,在很多的parser

    2024年02月08日
    浏览(31)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包