本地idea调试SpringBoot工程,报错 :
Caused by: org.I0Itec.zkclient.exception.ZkTimeoutException: Unable to connect to zookeeper server within timeout: 3000
1、SprintBoot单元测试连接zookeeper;
zookeeper注册中心开启了 安全认证,本地调试,无法注册;
需要增加VMOptions 配置:
-Dzookeeper.sasl.client=false
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-sFx1Nt7t-1632730972540)(C:UsersjessicaAppDataRoamingTyporatypora-user-imagesimage-20210927161752595.png)]
工程在本地可以启动成功!
2、使用SprintbootTest本地调试方法,又报了同样的错误:问题找了很久,我使用的motan发现服务,试着改下两个配置参数,把时间调大点,注册成功!
# 注册中心连接超时(ms) motan.registry.connectTimeout=30000 #注册中心请求超时时间(ms) motan.registry.requestTimeout=30000



