需要有jdk环境
安装java
yum list java-1.8* yum install java-1.8.0-openjdk* -y
安装zookeeper
下载地址:http://zookeeper.apache.org/
wget tar -zvxf apache-zookeeper-3.7.0-bin.tar.gz cd apache-zookeeper-3.7.0-bin
将目录移动到你喜欢的目录中:
mv apache-zookeeper-3.7.0-bin /usr/local/
进入./conf 复制配置文件:
cp zoo_sample.cfg zoo.cfg
启动
sh-4.4# ./bin/zkServer.sh start /usr/bin/java ZooKeeper JMX enabled by default Using config: /usr/local/apache-zookeeper-3.7.0-bin/bin/../conf/zoo.cfg Starting zookeeper ... STARTED
通过zk自带的客户端,检测服务是否启动成功:
sh-4.4# ./bin/zkCli.sh /usr/bin/java Connecting to localhost:2181