需要有jdk环境
安装java
代码语言:javascript复制yum list java-1.8*
yum install java-1.8.0-openjdk* -y
安装zookeeper
下载地址:http://zookeeper.apache.org/
代码语言:javascript复制wget
tar -zvxf apache-zookeeper-3.7.0-bin.tar.gz
cd apache-zookeeper-3.7.0-bin
将目录移动到你喜欢的目录中:
代码语言:javascript复制 mv apache-zookeeper-3.7.0-bin /usr/local/
进入./conf 复制配置文件:
代码语言:javascript复制cp zoo_sample.cfg zoo.cfg
启动
代码语言:javascript复制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自带的客户端,检测服务是否启动成功:
代码语言:javascript复制sh-4.4# ./bin/zkCli.sh
/usr/bin/java
Connecting to localhost:2181
本文为仙士可原创文章,转载无需和我联系,但请注明来自仙士可博客www.php20.cn