YxN 发表于 2016-12-20 20:38:45

macOS上zookeeper运行延迟5秒

在mac新搭了一个zookeeper环境。为java-web提供服务。服务器使用tomcat7.0。zookeeper版本为3.4.6。配置文件zoo没问题,启动正常,在运行zkCli.sh时延时5秒启动。tomcat启动时每一个dubbo接口的注册都需要5秒钟   导致项目部署时间超过两分钟。网上没有找到解决办法。我认为主要在于zookeeper连接本地时那5秒造成的原因。请各位帮助。不胜感激

YxN 发表于 2016-12-20 20:56:32

有人帮忙解答一下吗

easthome001 发表于 2016-12-20 21:20:07

YxN 发表于 2016-12-20 20:56
有人帮忙解答一下吗

这个需要看下zookeeper的启动日志。应该记录了启动过程。楼主可以分析下

YxN 发表于 2016-12-20 21:36:19

easthome001 发表于 2016-12-20 21:20
这个需要看下zookeeper的启动日志。应该记录了启动过程。楼主可以分析下

谢谢回答。配置文件和日志都翻烂了,没有问题。 项目启动时无报错。就是在dubbo接口注册的时候 一条一条的特别慢,每5秒钟注册一个dubbo的service接口。明天到单位把日志贴出来。

同事在mac 10.11上正常。在自己的win本上也正常。

还是感谢您的回复。

YxN 发表于 2016-12-21 09:42:25

zookeeper 日志信息

2016-12-21 09:41:12,950 - INFO - Got user-level KeeperException when processing sessionid:0x1591efd64ff0001 type:create cxid:0x9c zxid:0x384 txntype:-1 reqpath:n/a Error Path:/dubbo/com.mocentre.tehui.frontend.service.StoreManageService/providers Error:KeeperErrorCode = NodeExists for /dubbo/com.mocentre.tehui.frontend.service.StoreManageService/providers
2016-12-21 09:41:12,952 - INFO - Got user-level KeeperException when processing sessionid:0x1591efd64ff0001 type:create cxid:0x9e zxid:0x386 txntype:-1 reqpath:n/a Error Path:/dubbo Error:KeeperErrorCode = NodeExists for /dubbo
2016-12-21 09:41:12,953 - INFO - Got user-level KeeperException when processing sessionid:0x1591efd64ff0001 type:create cxid:0x9f zxid:0x387 txntype:-1 reqpath:n/a Error Path:/dubbo/com.mocentre.tehui.frontend.service.StoreManageService Error:KeeperErrorCode = NodeExists for /dubbo/com.mocentre.tehui.frontend.service.StoreManageService
2016-12-21 09:41:12,954 - INFO - Got user-level KeeperException when processing sessionid:0x1591efd64ff0001 type:create cxid:0xa0 zxid:0x388 txntype:-1 reqpath:n/a Error Path:/dubbo/com.mocentre.tehui.frontend.service.StoreManageService/configurators Error:KeeperErrorCode = NodeExists for /dubbo/com.mocentre.tehui.frontend.service.StoreManageService/configurators
2016-12-21 09:41:17,985 - INFO - Got user-level KeeperException when processing sessionid:0x1591efd64ff0001 type:create cxid:0xa3 zxid:0x389 txntype:-1 reqpath:n/a Error Path:/dubbo Error:KeeperErrorCode = NodeExists for /dubbo
2016-12-21 09:41:17,987 - INFO - Got user-level KeeperException when processing sessionid:0x1591efd64ff0001 type:create cxid:0xa4 zxid:0x38a txntype:-1 reqpath:n/a Error Path:/dubbo/com.mocentre.tehui.SubjectManageService Error:KeeperErrorCode = NodeExists for /dubbo/com.mocentre.tehui.SubjectManageService
2016-12-21 09:41:17,988 - INFO - Got user-level KeeperException when processing sessionid:0x1591efd64ff0001 type:create cxid:0xa5 zxid:0x38b txntype:-1 reqpath:n/a Error Path:/dubbo/com.mocentre.tehui.SubjectManageService/providers Error:KeeperErrorCode = NodeExists for /dubbo/com.mocentre.tehui.SubjectManageService/providers
2016-12-21 09:41:17,990 - INFO - Got user-level KeeperException when processing sessionid:0x1591efd64ff0001 type:create cxid:0xa7 zxid:0x38d txntype:-1 reqpath:n/a Error Path:/dubbo Error:KeeperErrorCode = NodeExists for /dubbo
2016-12-21 09:41:17,991 - INFO - Got user-level KeeperException when processing sessionid:0x1591efd64ff0001 type:create cxid:0xa8 zxid:0x38e txntype:-1 reqpath:n/a Error Path:/dubbo/com.mocentre.tehui.SubjectManageService Error:KeeperErrorCode = NodeExists for /dubbo/com.mocentre.tehui.SubjectManageService
2016-12-21 09:41:17,992 - INFO - Got user-level KeeperException when processing sessionid:0x1591efd64ff0001 type:create cxid:0xa9 zxid:0x38f txntype:-1 reqpath:n/a Error Path:/dubbo/com.mocentre.tehui.SubjectManageService/configurators Error:KeeperErrorCode = NodeExists for /dubbo/com.mocentre.tehui.SubjectManageService/configurators
2016-12-21 09:41:23,010 - INFO - Got user-level KeeperException when processing sessionid:0x1591efd64ff0001 type:create cxid:0xac zxid:0x390 txntype:-1 reqpath:n/a Error Path:/dubbo Error:KeeperErrorCode = NodeExists for /dubbo
2016-12-21 09:41:23,013 - INFO - Got user-level KeeperException when processing sessionid:0x1591efd64ff0001 type:create cxid:0xad zxid:0x391 txntype:-1 reqpath:n/a Error Path:/dubbo/com.mocentre.tehui.frontend.service.LoginManageService Error:KeeperErrorCode = NodeExists for /dubbo/com.mocentre.tehui.frontend.service.LoginManageService
2016-12-21 09:41:23,014 - INFO - Got user-level KeeperException when processing sessionid:0x1591efd64ff0001 type:create cxid:0xae zxid:0x392 txntype:-1 reqpath:n/a Error Path:/dubbo/com.mocentre.tehui.frontend.service.LoginManageService/providers Error:KeeperErrorCode = NodeExists for /dubbo/com.mocentre.tehui.frontend.service.LoginManageService/providers
2016-12-21 09:41:23,016 - INFO - Got user-level KeeperException when processing sessionid:0x1591efd64ff0001 type:create cxid:0xb0 zxid:0x394 txntype:-1 reqpath:n/a Error Path:/dubbo Error:KeeperErrorCode = NodeExists for /dubbo
2016-12-21 09:41:23,018 - INFO - Got user-level KeeperException when processing sessionid:0x1591efd64ff0001 type:create cxid:0xb1 zxid:0x395 txntype:-1 reqpath:n/a Error Path:/dubbo/com.mocentre.tehui.frontend.service.LoginManageService Error:KeeperErrorCode = NodeExists for /dubbo/com.mocentre.tehui.frontend.service.LoginManageService
2016-12-21 09:41:23,019 - INFO - Got user-level KeeperException when processing sessionid:0x1591efd64ff0001 type:create cxid:0xb2 zxid:0x396 txntype:-1 reqpath:n/a Error Path:/dubbo/com.mocentre.tehui.frontend.service.LoginManageService/configurators Error:KeeperErrorCode = NodeExists for /dubbo/com.mocentre.tehui.frontend.service.LoginManageService/configurators

YxN 发表于 2016-12-21 09:44:50

项目启动日志信息webkit-fake-url://ee42a2f1-07fc-4a14-982a-1b5ac991b027/image.tiff

about-xin2 发表于 2017-1-5 16:35:03

我也遇到这个问题了,请问楼主解决了吗

einhep 发表于 2017-1-5 17:10:28

about-xin2 发表于 2017-1-5 16:35
我也遇到这个问题了,请问楼主解决了吗

虽然提示了,这应该不是错误。

about-xin2 发表于 2017-1-5 17:49:23

einhep 发表于 2017-1-5 17:10
虽然提示了,这应该不是错误。

我的情况是这样的:
macos第一次安装完成zookeeper后,./zkServer.sh start-foreground正常启动。项目用的是dubbo服务框架,向zookeeper注册服务。然后其他项目调用服务。第一次项目运行都是正常的。

但是macos重启之后,zookeeper启动就已经会有延迟,会卡在读取zoo.cfg文件大概5秒钟。然后再启动项目向zookeeper注册服务的时候,注册一个服务很慢很慢,而且zookeeper会报错

EndOfStreamException: Unable to read additional data from client sessionid 0x0, likely client has closed socket
        at org.apache.zookeeper.server.NIOServerCnxn.doIO(NIOServerCnxn.java:228)
        at org.apache.zookeeper.server.NIOServerCnxnFactory.run(NIOServerCnxnFactory.java:203)
        at java.lang.Thread.run(Thread.java:745)


虽然从结果来看,服务也已经注册成功了,但之后调用服务的时候,会报超时错误。

这个问题已经困扰我很多天了,希望不吝赐教。谢谢!

about-xin2 发表于 2017-1-5 17:50:54

YxN 发表于 2016-12-20 21:36
谢谢回答。配置文件和日志都翻烂了,没有问题。 项目启动时无报错。就是在dubbo接口注册的时候 一条一条 ...

我的项目也是这种情况,在windows下运行正常,但是在mac下总是报错
页: [1] 2
查看完整版本: macOS上zookeeper运行延迟5秒