in zookeeper ,during certain io pressure,the client will try to reconnect to quorum.after that,the quorum peer will return a new session timeout (akka negotiatedSessionTimeout) to former,then client will recompulate the real connTimeout and readTimeout from the response .the negotiatedSessionTimeout is a safe threshold which is bound to a window between ([minSessionTimeout,maxSessionTimeout]).
that means if u first use a self-defined sesion timeout to connect to a zookeeper quorum,only the first time thi s timeout is effect to yourself.
quorum side:
negotiatedSessionTimeout=[minSessionTimeout,maxSessionTimeout]
client side:
readTimeout = negotiatedSessionTimeout * 2 / 3; //-here is same as in constructor connectTimeout = negotiatedSessionTimeout / hostProvider.size();
but the diferences in this case between 3.4.3 and 3.5 are huge,
3.4.3 QuorumPeer
/** minimum session timeout in milliseconds */ public int getMinSessionTimeout() { return minSessionTimeout == -1 ? tickTime * 2 : minSessionTimeout; } /** minimum session timeout in milliseconds */ public void setMinSessionTimeout(int min) { LOG.info("minSessionTimeout set to " + min); this.minSessionTimeout = min; } /** maximum session timeout in milliseconds */ public int getMaxSessionTimeout() { return maxSessionTimeout == -1 ? tickTime * 20 : maxSessionTimeout; }
3.5 QuorumPeerConf#parseProperties()
minSessionTimeout = minSessionTimeout == -1 ? tickTime * 2 : minSessionTimeout; maxSessionTimeout = maxSessionTimeout == -1 ? tickTime * 20 : maxSessionTimeout;
they are the same effective though with changes
conclusion
1.client session timeout will be reset after retry to connect quorum
2.the sessionTimeout finally will be divided to connectTimeout and readTimeout,so the retry mechanism will really implement the 'restrict timeout' meaning.
3.the return negotiatedSessionTimeout will be minSessionTimeout if your self-defined sessionTimeout less than it;else will be max one if your sessionTimeout bigger than max;else the same as yours.
so by default ,if u set 2000 ms for one tick,then the returned timeout will be 20 ticks(40000 ms) if u give one larger than max(20 ticks) .this case is usually happened in general.
相关推荐
apache-zookeeper-3.7.1 apache-zookeeper-3.7.1 apache-zookeeper-3.7.1 apache-zookeeper-3.7.1 apache-zookeeper-3.7.1 apache-zookeeper-3.7.1 apache-zookeeper-3.7.1 apache-zookeeper-3.7.1 apache-zookeeper...
zookeeper-3.4.14,包含添加系统服务插件及添加bat. 1. zookeeper-3.4.14源包 2. commons-daemon-1.1.0-bin-windows.zip 插件 3. 配置好插件的zookeeper-3.4.14包,右键管理员权限执行zk-server-install.bat
zookeeper-3.4.9.tar.gz
apache-zookeeper-3.6.0.tar.gz
zookeeper-3.4.5-cdh5.16.2.tar.gz 资源包,之前的原网站上无法下载,后经多种途径下载到该资源包,上传到博客上供大家使用。
apache-zookeeper-3.5.7-bin.tar.gz 。
zookeeper-3.4.8zookeeper-3.4.8zookeeper-3.4.8zookeeper-3.4.8
赠送jar包:zookeeper-3.4.10.jar; 赠送原API文档:zookeeper-3.4.10-javadoc.jar; 赠送源代码:zookeeper-3.4.10-sources.jar; 赠送Maven依赖信息文件:zookeeper-3.4.10.pom; 包含翻译后的API文档:zookeeper-...
放在压缩包里了, 在windows下解压出"zookeeper-3.4.14.tar.gz"之后上传至虚拟机即可
apache-zookeeper分布式框架,压缩包内容:(apache-zookeeper-3.7.1-bin.tar.gz、apache-zookeeper-3.7.1.tar.gz、apache-zookeeper-3.6.4-bin.tar.gz、apache-zookeeper-3.6.4.tar.gz、apache-zookeeper-3.5.10-...
赠送jar包:zookeeper-3.3.3.jar; 赠送原API文档:zookeeper-3.3.3-javadoc.jar; 赠送源代码:zookeeper-3.3.3-sources.jar; 包含翻译后的API文档:zookeeper-3.3.3-javadoc-API文档-中文(简体)版.zip 对应...
ZooKeeper是一个分布式的,开放源码的分布式应用程序协调...ZooKeeper代码版本中,提供了分布式独享锁、选举、队列的接口,代码在zookeeper-3.4.3\src\recipes。其中分布锁和队列有Java和C两个版本,选举只有Java版本。
zookeeper-3.4.8.jar
zookeeper-3.4.5.jar; zookeeper-3.4.5.jar; zookeeper-3.4.5.jar;
最新版linux apache-zookeeper-3.7.0-bin.tar.gz最新版linux apache-zookeeper-3.7.0-bin.tar.gz
zookeeper-3.5.7.zip文件 zookeeper-3.5.7.zip文件 zookeeper-3.5.7.zip文件 zookeeper-3.5.7.zip文件 zookeeper-3.5.7.zip文件 zookeeper-3.5.7.zip文件 zookeeper-3.5.7.zip文件 zookeeper-3.5.7.zip文件 ...
zookeeper-3.4.6 解压后可直接运行 bin/zkServer.cmd 来启动
zookeeper-3.4.10和zookeeper-3.4.12
apache-zookeeper-3.5.5.tar.gz,zookeeper的安装文件,解压后配置集群即可
apache-zookeeper-3.7.0-bin.tar.gz