ClickHouse 3s1r 集群安装 | Zookeeper集群

  |   0 评论   |   0 浏览

ZooKeeper 3.5.8 集群安装

官方文档

https://zookeeper.apache.org/doc/r3.5.8/zookeeperStarted.html#sc_RunningReplicatedZooKeeper

下载

cd /app/software
wget -c http://archive.apache.org/dist/zookeeper/stable/apache-zookeeper-3.5.8-bin.tar.gz

主机准备 CentOS7

  • 192.168.1.18
  • 192.168.1.19
  • 192.168.1.20

三节点都执行

mkdir -p /data/zookeeper/{data,log}

ip18 执行
cd /data/zookeeper/data
echo 1 > myid

ip19 执行
cd /data/zookeeper/data
echo 2 > myid

ip20 执行
cd /data/zookeeper/data
echo 3 > myid

安装路径

cd /usr/local/
cp /app/software/apache-zookeeper-3.5.8-bin.tar.gz ./
tar -zxvf apache-zookeeper-3.5.8-bin.tar.gz

配置文件准备

cd /usr/local/apache-zookeeper-3.5.8-bin/conf
cp zoo_sample.cfg zoo.cfg

修改 zoo.cfg

# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial 
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between 
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just 
# example sakes.
dataDir=/data/zookeeper/data
dataLogDir=/data/zookeeper/log
# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the 
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1
server.1=192.168.1.18:2888:3888
server.2=192.168.1.19:2888:3888
server.3=192.168.1.20:2888:3888

启动 停止 状态

cd /usr/local/apache-zookeeper-3.5.8-bin/

启动 默认用 conf/zoo.cfg 配置文件
./bin/zkServer.sh start

指定配置文件启动
./bin/zkServer.sh start conf/zoo.cfg

停止

./bin/zkServer.sh stop

查看状态

./bin/zkServer.sh status

添加环境变量

vim /etc/profile
追加到PATH
/usr/local/apache-zookeeper-3.5.8-bin/bin
source /etc/profile

客户端连接


标题:ClickHouse 3s1r 集群安装 | Zookeeper集群
作者:uid1024
地址:http://javadaily.cn/articles/2021/01/05/1609831912222.html