linux 安装启动zookeeper全过程及遇到的坑

发布于:2025-02-19 ⋅ 阅读:(132) ⋅ 点赞:(0)

1、下载安装zookeeper

参考文章:https://blog.csdn.net/weixin_48887095/article/details/132397448


2、启动失败

1、启动失败JAVA_HOME is not set and java could not be found in PATH


2、启动失败 ClassNotFoundException: org.apache.zookeeper.server.quorum.QuorumPeerMain

[root@xxx] zkServer.sh start-foreground

ZooKeeper JMX enabled by default
Using config: /usr/local/zookeeper/bin/../conf/zoo.cfg
Error: Could not find or load main class org.apache.zookeeper.server.quorum.QuorumPeerMain
Caused by: java.lang.ClassNotFoundException: org.apache.zookeeper.server.quorum.QuorumPeerMain

在这里插入图片描述
解决方法:https://blog.csdn.net/weixin_48887095/article/details/132397448


3、启动失败,端口8080被占用 Caused by: java.io.IOException: Failed to bind to /0.0.0.0:8080

在这里插入图片描述
解决方法:


4、启动失败,端口2181被占用 java.net.BindException: Address already in use

在这里插入图片描述

3 启动成功

  • 服务端启动成功:bash zkServer.sh status start
  • 查看服务端状态:bash zkServer.sh status
  • 停止服务端:bash zkServer.sh stop
  • 启动客户端:bash zkCli.sh

在这里插入图片描述


网站公告

今日签到

点亮在社区的每一天
去签到