标签:环境变量 sam sample class 集群 进程 ado math sla
put zookeeper-3.4.5.tar.gz
tar -zxvf zookeeper-3.4.5.tar.gz
# 重命名文件夹
mv zookeeper-3.4.5 zookeeper
vi /etc/profile
export ZOOKEEPER_HOME=/home/hadoop/zookeeper
export PATH=$PATH:$ZOOKEEPER_HOME/bin
source /etc/profile
cd zookeeper/conf
cp zoo_sample.cfg zoo.cfg
vi zoo.cfg
# 添加内容
dataDir=/home/hadoop/zookeeper/data
dataLogDir=/home/hadoop/zookeeper/log
# 主机名, 心跳端口、数据端口
server.1=slave1:2888:3888
server.2=slave2:2888:3888
server.3=slave3:2888:3888
# 创建文件夹
cd /home/hadoop/zookeeper/
mkdir -m 755 data
mkdir -m 755 log
# 新建myid文件
cd data
vi myid
# 添加内容
1
scp -r /home/hadoop/zookeeper hadoop@slave2:/home/hadoop/
scp -r /home/hadoop/zookeeper hadoop@slave3:/home/hadoop/
到slave2上:修改myid为:2
到slave3上:修改myid为:3
zkServer.sh start
jps(查看进程)
zkServer.sh status(查看集群状态,主从信息)
标签:环境变量 sam sample class 集群 进程 ado math sla
原文地址:http://www.cnblogs.com/wesly186/p/e9bf2c5c27af52290ab1f554d85715cb.html