一、下载并解压
下载地址
1 2 3 4 5
| mkdir /usr/local/zookeeper cd /usr/local/zookeeper wget https://dlcdn.apache.org/zookeeper/zookeeper-3.7.0/apache-zookeeper-3.7.0-bin.tar.gz tar -zxvf apache-zookeeper-3.7.0-bin.tar.gz mv apache-zookeeper-3.7.0-bin apache-zookeeper-3.7.0
|
二、修改配置文件
1 2 3
| cd apache-zookeeper-3.7.0/conf cp zoo_sample.cfg zoo.cfg vi zoo.cfg
|
结尾加上admin.serverPort=8090
并保存(端口默认8080,不改也行)
三、环境变量
在末尾添加以下后保存,如果path有值了,就加冒号在末尾追加
1 2
| export ZOOKEEPER_HOME=/usr/local/zookeeper/apache-zookeeper-3.7.0 export PATH=$PATH:$ZOOKEEPER_HOME/bin
|
追加示例:
1
| export PATH=$PATH:$JAVA_HOME/bin:$ZOOKEEPER_HOME/bin
|
刷新配置文件
四、启动