首先是平台为macOS 10.12
ide为eclipse,项目搭载到tomcat7.0
项目为java-web
zookeeper使用为 3.4.6 (尝试过最新3.5.2)
zoo.cfg配置为
The number of milliseconds of each tick
tickTime=2000
The number of ticks that the initial
synchronization phase can take
initLimit=10
The number of ticks that can pass between
sending a request and getting an acknowledgement
syncLimit=5
the directory where the snapshot is stored.
do not use /tmp for storage, /tmp here is just
example sakes.
dataDir=/Users/yukaiji/Documents/tmp/ttehui
the port at which the clients will connect
clientPort=2181
the maximum number of client connections.
increase this if you need to handle more clients
maxClientCnxns=60
Be sure to read the maintenance section of the
administrator guide before turning on autopurge.
http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
The number of snapshots to retain in dataDir
autopurge.snapRetainCount=3
Purge task interval in hours
Set to "0" to disable auto purge feature
autopurge.purgeInterval=1
hosts 设置为本机 ip 本机名称
zkSever.sh. 启动正常。 日志文件 无错误,jps查看端口正常。
zkCli.sh. 启动 约 5 秒
目前认为是重点,配置文件反复看了很多次了。 2181 端口正常
启动java-web项目,在注册dubbo接口(managerService)的时候,一个大约5秒钟。
在win环境下 启动项目整体约30秒,现在启动是两分钟多点。排查了一天半,不清楚因为什么。
日志信息就是在dubbo接口注册的时候非常慢。
这里还有个问题需要请教,每一个接口的注册,都需要重新连接zookeeper吗?因为每一个接口间隔5s 很均匀。
在这里向各位请教。不胜感激。新入门没有币