zookeeper 集群部署
zookeeper集群部署
1.1 安装包下载
wget https://downloads.apache.org/zookeeper/zookeeper-3.6.3/apache-zookeeper-3.6.3-bin.tar.gz
2.1 解压安装包
tar zxvf apache-zookeeper-3.6.3-bin.tar.gz -C /opt/
mv /opt/apache-zookeeper-3.6.3-bin/ /opt/zookeeper
cp /opt/zookeeper/conf/zoo_sample.cfg /opt/zookeeper/conf/zoo.cfg
3.1 编辑配置文件
mkdir -p /opt/zookeeper/data
vim /opt/zookeeper/conf/zoo.cfg
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/opt/zookeeper/data
clientPort=2181
server.1=192.168.2.172:2888:3888
server.2=192.168.61.175:2888:3888
server.3=192.168.58.229:2888:3888
集群和伪集群的区别是这个配置文件的三台机器ip,伪集群是在一台机器上,只是端口不一样,集群是ip不一样