下载ZK代码
git clone [email protected]:wangjingqian1995/zookeeper.git
cd zookeeper
git checkout branch-3.8
设置环境变量
echo "export ZOOKEEPER_HOME=/root/code/java/zookeeper" >> /etc/profile
echo "export PATH=$PATH:$ZOOKEEPER_HOME/bin" >> /etc/profile
source /etc/profile
设置配置文件
cd conf
cp zoo_sample.cfg zoo.cfg
echo "dataDir=/root/code/java/zookeeper/data" >> zoo.cfg
echo "dataLogDir=/root/code/java/zookeeper/logs" >> zoo.cfg
Error: Could not find or load main class org.apache.zookeeper.server.quorum.QuorumPeerMain
安装Maven并编译
cd $ZOOKEEPER_HOME/zookeeper-server
mvn clean install -Dmaven.test.skip=true
启动ZK
cd $ZOOKEEPER_HOME/bin
./zkServer.sh start
标签:zookeeper,cfg,ZooKeeper,echo,源码,git,HOME,cd,安装 From: https://www.cnblogs.com/WJQ2017/p/17557857.html