Zookeeper--HA搭建
1. 上传zookeeper解压:
tar -zxvf zookeeper-3.4.5.tar.gz
2. 修改配置文件[三台节点]
[node123]# cd /opt/app/data/zookeeper-3.4.5/conf/
[node123]# mv zoo_sample.cfg zoo.cfg
[node123]# vim zoo.cfg
{
dataDir=/opt/app/zookeeper-3.4.5/zookeeper
server.1=node1:2888:3888
server.2=node2:2888:3888
server.3=node3:2888:3888
}
[node123]# cd /opt/app/zookeeper-3.4.5/zookeeper
[node1]# vi myid
{
1
}
[node2]# vi myid
{
2
}
[node3]# vi myid
{
3
}
# 配置环境
[node123]# vi /etc/profile
{
export ZOOKEEPER_HOME=/opt/app/zookeeper-3.4.5
export PATH=$PATH:$ZOOKEEPER_HOME/bin
}
[node123]# source /etc/profile
# 启动zookeeper
zkServer.sh start
# 查看状态
zkServer.sh status
# 停止zookeeper的执行
zkServer.sh stop
本文来自博客园,作者:jsqup,转载请注明原文链接:https://www.cnblogs.com/jsqup/p/16673097.html