1. 下载
链接:
http://zookeeper.apache.org/releases.html https://archive.apache.org/dist/zookeeper/
2. 上传
通过 MobaXterm stfp功能
上传文件到 /opt/pkg3. 解压
三台机器都需要安装,配置
tar -zxvf zookeeper-3.4.6.tar.gz -C /opt/software/ --解压到指定路径
4. 配置文件
cd /opt/software/zookeeper-3.4.6/conf cp zoo_sample.cfg zoo.cfg
vi zoo.cfg
clientPort=2181 dataDir=/opt/software/zookeeper/data dataLogDir=/opt/software/zookeeper/logs server.1=0.0.0.0:2881:3881 --阿里云 本机都配置0.0.0.0 其他两台机器,就是ip server.2=cdh02:2881:3881 server.3=cdh03:2881:3881
第二台机器
clientPort=2181 dataDir=/opt/software/zookeeper/data dataLogDir=/opt/software/zookeeper/logs server.1=cdh01:2881:3881 server.2=0.0.0.0:2881:3881 server.3=cdh03:2881:3881
第三台机器
clientPort=2181 dataDir=/opt/software/zookeeper/data dataLogDir=/opt/software/zookeeper/logs server.1=cdh01:2881:3881 server.2=cdh02:2881:3881 server.3=0.0.0.0:2881:3881
5.创建数据存放目录,并创建myid文件
mkdir -p /opt/software/zookeeper/data mkdir -p /opt/software/zookeeper/logs
cd /opt/software/zookeeper/data/ echo 1 > myid echo 2 > myid --其他两台分别是2 和 3 echo 3 > myid --其他两台分别是2 和 3
6. 配置环境变量
vim /etc/profile.d/my_env.sh
export ZOOKEEPER_HOME=/opt/software/zookeeper-3.4.6 export PATH=$PATH:$ZOOKEEPER_HOME/bin
source /etc/profile.d/my_env.sh --刷新
7.启动
三台依次启动
cd /opt/software/zookeeper-3.4.6/ bin/zkServer.sh start
查看状态
bin/zkServer.sh status
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)