Linux安装zookeeper

Posted misterwu

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Linux安装zookeeper相关的知识,希望对你有一定的参考价值。

1:将zookeeper压缩包上传到/ustr/local/mysoft目录下

技术图片

2:cd /usr/local/mysoft/  进入mysoft目录

[root@localhost bin]# cd /usr/local/mysoft/
[root@localhost mysoft]# ls
apache-maven-3.5.4  apache-tomcat-7.0.93  jdk1.8.0_212  mysql  redis-4.0.9  zookeeper-3.4.6.tar.gz

3:tar -zxvf zookeeper-3.4.6.tar.gz  解压zookeeper压缩包

[root@localhost mysoft]# tar -zxvf zookeeper-3.4.6.tar.gz 
[root@localhost mysoft]# ls
apache-maven-3.5.4  apache-tomcat-7.0.93  jdk1.8.0_212  mysql  redis-4.0.9  zookeeper-3.4.6  zookeeper-3.4.6.tar.gz

4:进入解压后的zookeeper目录下的conf目录

[root@localhost mysoft]# cd zookeeper-3.4.6/conf/
[root@localhost conf]# ls
configuration.xsl  log4j.properties  zoo_sample.cfg 

5: mv zoo_sample.cfg zoo.cfg   将zoo_sample.cfg 文件重命名为zoo.cfg

[root@localhost conf]# mv zoo_sample.cfg zoo.cfg 
[root@localhost conf]# ls
configuration.xsl  log4j.properties  zoo.cfg

6:进入zookeeper目录下的bin目录

[root@localhost conf]# cd /usr/local/mysoft/zookeeper-3.4.6/bin/
[root@localhost bin]# ls
README.txt  zkCleanup.sh  zkCli.cmd  zkCli.sh  zkEnv.cmd  zkEnv.sh  zkServer.cmd  zkServer.sh  zookeeper.out

7:./zkServer.sh start  开启zookeeper服务( ./zkServer.sh stop  关闭zookeeper )

[root@localhost bin]# ./zkServer.sh start
JMX enabled by default
Using config: /usr/local/mysoft/zookeeper-3.4.6/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED

8:./zkServer.sh status  查看zookeeper状态,如果出现如下内容,说明你的zookeeper已经开启

[root@localhost bin]# ./zkServer.sh status
JMX enabled by default
Using config: /usr/local/mysoft/zookeeper-3.4.6/bin/../conf/zoo.cfg
Mode: standalone

9:systemctl stop firewalld.service    关闭防火墙,有时我们zookeeper已经开启,但程序运行时连接不到zookeeper,可能因为连接请求被Linux防火墙拦截了,需要关闭防火墙

 

以上是关于Linux安装zookeeper的主要内容,如果未能解决你的问题,请参考以下文章

Linux系统下安装zookeeper

Linux下安装zookeeper教程

linux安装zookeeper

Linux之Zookeeper本地安装

Linux安装zookeeper集群

Zookeeper 之Linux 安装启动