`

zookeeper-negotiated session timeout

 
阅读更多

  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.

 

  • 大小: 46 KB
0
1
分享到:
评论

相关推荐

    apache-zookeeper(apache-zookeeper-3.7.1-bin.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-...

    zookeeper-3.4.5-cdh5.16.2.tar.gz

    《Zookeeper-3.4.5-cdh5.16.2:分布式协调服务的核心解析》 Apache ZooKeeper,一个高度可靠的分布式协调系统,是大数据生态中的重要组件。本资源包"zookeeper-3.4.5-cdh5.16.2.tar.gz"包含了Zookeeper的3.4.5版本...

    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-3.7.1 apache-zookeeper...

    zookeeper-3.4.10-API文档-中文版.zip

    赠送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-...

    zookeeper-3.8.0安装包下载

    Zookeeper-3.8.0 是该系统的最新版本,提供了更稳定和高效的服务。 Zookeeper 的核心概念包括节点(Znode)、会话(Session)和观察者(Watcher)。Znode 是 Zookeeper 数据存储的基本单位,类似于文件系统中的节点...

    zookeeper-3.4.10.tar.gz

    2. 修改配置文件:在`zookeeper-3.4.10/conf`目录下,有一个名为`zoo_sample.cfg`的示例配置文件,复制并重命名为`zoo.cfg`,这是ZooKeeper的主要配置文件。 3. 配置`zoo.cfg`: - `dataDir`:设置ZooKeeper的数据...

    apache-zookeeper-3.6.2-bin.tar

    apache-zookeeper-3.6.2-bin.tar apache-zookeeper-3.6.2-bin.tar apache-zookeeper-3.6.2-bin.tar apache-zookeeper-3.6.2-bin.tar apache-zookeeper-3.6.2-bin.tar apache-zookeeper-3.6.2-bin.tar apache-...

    apache-zookeeper-3.5.6-bin.tar

    在 `apache-zookeeper-3.5.6-bin.tar` 这个压缩包中,包含了 Apache ZooKeeper 3.5.6 版本的二进制文件,这是部署和运行 ZooKeeper 服务所必需的。这个版本引入了多项改进和修复,使得 ZooKeeper 更加稳定和高效。 ...

    apache-zookeeper-3.5.7-bin.tar.gz

    这个压缩包"apache-zookeeper-3.5.7-bin.tar.gz"是Zookeeper的可执行二进制文件包,用于在Linux或Unix类操作系统上部署和运行Zookeeper服务器。 **Zookeeper的基本概念:** 1. **节点(ZNode)**:Zookeeper的数据...

    zookeeper-3.3.3-API文档-中文版.zip

    赠送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 对应...

    apache-zookeeper-3.8.4-bin.tar

    1. 解压`apache-zookeeper-3.8.4-bin.tar`到指定目录。 2. 配置`conf/zoo.cfg`,设置服务器ID、数据存储路径、集群配置等。 3. 启动Zookeeper服务,使用`bin/zkServer.sh start`命令。 4. 使用`bin/zkCli.sh`命令行...

    zookeeper-3.4.11.tar.gz

    ZooKeeper是一个分布式的,开放源码的分布式应用程序协调...ZooKeeper代码版本中,提供了分布式独享锁、选举、队列的接口,代码在zookeeper-3.4.3\src\recipes。其中分布锁和队列有Java和C两个版本,选举只有Java版本。

    zookeeper-3.4.8.jar

    zookeeper-3.4.8.jar

    zookeeper-3.4.5.jar zookeeper-3.4.5.jar

    zookeeper-3.4.5.jar; zookeeper-3.4.5.jar; zookeeper-3.4.5.jar;

    zookeeper-3.4.6.jar

    zookeeper-3.4.6.jar

    zookeeper-3.4.6_zookeeper_

    在标题“zookeeper-3.4.6_zookeeper_”中,我们可以看到这是关于Zookeeper的一个特定版本——3.4.6的讨论。这个版本的发布对于理解和使用Zookeeper至关重要,因为它包含了该框架的稳定性和功能增强。 在描述“注册...

    linux中zookeeper安装包zookeeper-3.4.8.tar

    总结来说,Zookeeper-3.4.8是一个强大的分布式协调服务,其安装包中的`zookeeper-3.4.8.jar`和`slf4j-api-1.6.1.jar`是运行和管理Zookeeper所必需的。通过理解和掌握Zookeeper的工作原理及其配置,开发者可以有效地...

    apache-zookeeper-3.6.3-bin.tar的压缩包,解压到本地即可使用,还有zk.sh的脚本以及zoo.cfg

    apache-zookeeper-3.6.3-bin.tar的压缩包,解压到本地即可使用,还有zk.sh的脚本以及zoo.cfg和xsync。ZooKeeper 是一个分布式协调服务 ,由 Apache 进行维护。ZooKeeper 可以视为一个高可用的文件系统。ZooKeeper ...

    apache-zookeeper-3.7.1-bin.tar.gz

    apache-zookeeper-3.7.1-bin.tar.gz 内容概要:通过带着读者手写简化版Spring框架,了解Spring核心原理。在手写Spring源码的过程中会摘取整体框架中的核心逻辑,简化代码实现过程,保留核心功能,例如:IOC, AOP、 Bean...

    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.5.7.zip文件 ...

Global site tag (gtag.js) - Google Analytics