zookeeper单机服务器启动流程

zookeeper单机服务器启动流程


一、源码编译

源码编译

编译zookeeper源码
1:ant eclipse

2:将bulild.xml中的(1900多行的地方)
get src="http://downloads.sourceforge.net/project/ant-eclipse/ant-eclipse/1.0/ant-eclipse-1.0.bin.tar.bz2"
替换成如下地址
get src="http://ufpr.dl.sourceforge.net/project/ant-eclipse/ant-eclipse/1.0/ant-eclipse-1.0.bin.tar.bz2"

3: import project 选择eclipse

4:
tickTime=2000000
initLimit=10
syncLimit=5
dataDir=F:\\lry\\project\\zookeeper-release-3.4.14\\data
dataLogDir=F:\\lry\\project\\zookeeper-release-3.4.14\\log
clientPort=2181


5:vm options:-Dlog4j.configuration=file:F:\lry\project\zookeeper-release-3.4.14\conf\log4j.properties

6:program argu : F:\lry\project\zookeeper-release-3.4.14\conf\zoo.cfg

7: 
package org.apache.zookeeper.version;

public interface Info {
    int MAJOR=1;
    int MINOR=0;
    int MICRO=0;
    String QUALIFIER=null;
    int REVISION=-1; //TODO: remove as related to SVN VCS
    String REVISION_HASH="1";
    String BUILD_DATE="2019-3-4";
}

二、启动流程

ps: 启动类是ZookeeperServerMain

main函数
在这里插入图片描述
解析jvm参数,拿到zoo.cfg的路径,解析配置文件
在这里插入图片描述
代码是我根据源码改的,方便截图
在这里插入图片描述

在这里插入图片描述

在这里插入图片描述
设置请求处理链:prep-> sync -> final
在这里插入图片描述

总结

在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值