tar -xvf zookeeper-3.4.6.tar.gz
mv /home/hadoop/soft/zookeeper-3.4.6 /home/hadoop/install
cd /home/hadoop/install
修改环境变量
vim /etc/profile
export JAVA_HOME=/usr/local/jdk
export HADOOP_HOME=/home/hadoop/install/hadoop-2.7.4
export MYSQL_HOME=/usr/local/mysql
export ZOOKEEPER_HOME=/home/hadoop/install/zookeeper-3.4.6
export HIVE_HOME=/home/hadoop/install/hive
export PS1="[\u@\h \w]$"
export PATH=
P
A
T
H
:
PATH:
PATH:JAVA_HOME/bin:
H
A
D
O
O
P
H
O
M
E
/
b
i
n
:
HADOOP_HOME/bin:
HADOOPHOME/bin:HADOOP_HOME/sbin:
M
Y
S
Q
L
H
O
M
E
/
b
i
n
:
MYSQL_HOME/bin:
MYSQLHOME/bin:HIVE_HOME/bin:$ZOOKEEPER_HOME/bin
source /etc/profile
修改配置文件
vim ~/install/zookeeper-3.4.6/conf
vim zoo.cfg
clientPort=2181
tickTime=2000
initLimit=5
syncLimit=2
dataDir=/data/zookeeper/data
dataLogDir=/data/zookeeper/logs
server.1=master:2888:3888
server.2=slave1:2888:3888
server.3=slave2:2888:3888