`

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

    apache-zookeeper-3.5.10-bin 环境搭配

    apache-zookeeper-3.5.10-bin 环境搭配 ZooKeeper是一个分布式的,开放源码的分布式应用程序协调服务,是Google的Chubby一个开源的实现,是Hadoop和Hbase的重要组件。它是一个为分布式应用提供一致性服务的软件,...

    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 数据存储的基本单位,类似于文件系统中的节点...

    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.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 更加稳定和高效。 ...

    zookeeper-3.4.5-cdh5.15.1.tar.gz

    1. **下载与解压**:首先,你需要从官方或镜像站点下载Zookeeper的tar.gz压缩包,即"zookeeper-3.4.5-cdh5.15.1.tar.gz"。下载完成后,使用`tar -zxvf zookeeper-3.4.5-cdh5.15.1.tar.gz`命令进行解压。 2. **配置...

    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.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版本。

    apache-zookeeper-3.6.3-bin.zip

    打开“系统属性” -> “高级” -> “环境变量”,在“系统变量”部分新建一个变量,变量名为"ZOOKEEPER_HOME",变量值设置为Zookeeper解压后的路径,即"C:\Zookeeper\apache-zookeeper-3.6.3-bin"。 然后,在系统...

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

    zookeeper-3.4.6.jar

    在压缩包子文件的文件名称列表"zookeeper -3.4.6"中,我们可以推测这可能是一个完整的Zookeeper 3.4.6版本的下载包,除了"zookeeper-3.4.6.jar"外,还可能包括配置文件、文档、示例代码以及其他必要的组件。...

    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;

Global site tag (gtag.js) - Google Analytics