CentOS安装zookeeper

CentOS安装zookeeper,第1张

CentOS安装zookeeper
  • 下载地址
    https://zookeeper.apache.org/releases.html

  • 创建目录复制安装包到安装目录

[root@localhost package]# mkdir -p /snt/soft/zookeeper
[root@localhost package]# cd /snt/soft/zookeeper
[root@localhost zookeeper]# ls 
[root@localhost zookeeper]# cp /snt/soft/package/apache-zookeeper-3.6.2-bin.tar.gz .
[root@localhost zookeeper]# ls 
apache-zookeeper-3.6.2-bin.tar.gz
[root@localhost zookeeper]# tar -zxvf apache-zookeeper-3.6.2-bin.tar.gz
  • 拷贝配置文件
[root@localhost apache-zookeeper-3.6.2-bin]# cd conf/
[root@localhost conf]# ls 
configuration.xsl  log4j.properties  zoo_sample.cfg
[root@localhost conf]# cp zoo_sample.cfg zoo.cfg
[root@localhost conf]# ls 
configuration.xsl  log4j.properties  zoo.cfg  zoo_sample.cfg
  • 配置
mkdir -p /snt/data/zookeeper
[snt@JAVA-DEVELOPMENT conf]$ vim zoo.cfg
dataDir=/snt/data/zookeeper

  • 启动
[root@localhost apache-zookeeper-3.6.2-bin]# cd bin/
[root@localhost bin]# ls 
README.txt    zkCli.sh   zkServer.cmd            zkSnapShotToolkit.cmd  zkTxnLogToolkit.sh
zkCleanup.sh  zkEnv.cmd  zkServer-initialize.sh  zkSnapShotToolkit.sh
zkCli.cmd     zkEnv.sh   zkServer.sh             zkTxnLogToolkit.cmd
[root@localhost bin]# ./zkServer.sh start
ZooKeeper JMX enabled by default
Using config: /snt/soft/zookeeper/apache-zookeeper-3.6.2-bin/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
  • 查看状态
[root@localhost bin]# ./zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /snt/soft/zookeeper/apache-zookeeper-3.6.2-bin/bin/../conf/zoo.cfg
Client port found: 2181. Client address: localhost. Client SSL: false.
Mode: standalone

故障
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-KTxZttZP-1634633625269)(http://192.168.10.61:9001/server/…/Public/Uploads/2021-04-07/606d21df8d117.png)]
上面的结果看似已经启动了,但是,我们再用命令zkServer.sh status查看状态时,却出现了下面的信息:
报了错:Error contacting service. It is probably not running.

这说明并没有启动成功!
问题分析
我们可以通过bin目录下面的zookeeper.out来查看问题原因
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-gkZSx6NA-1634633625272)(http://192.168.10.61:9001/server/…/Public/Uploads/2021-04-07/606d222e3d741.png)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-5Ce108sj-1634633625275)(http://192.168.10.61:9001/server/…/Public/Uploads/2021-04-07/606d2241aa448.png)]
java未安装
故障排查参考文档:
https://blog.csdn.net/qq_26230421/article/details/80700912

  • 参考
    https://blog.csdn.net/milhua/article/details/78931672
    https://www.cnblogs.com/jimcsharp/p/8358271.html

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/4666872.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-11-06
下一篇 2022-11-06

发表评论

登录后才能评论

评论列表(0条)

保存