ZooKeeper启动报错,未成功开启服务
1、问题示例
(1)启动ZooKeeper服务报错
[Hadoop@master ~]$ zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /home/Hadoop/ZooKeeper/zookeeper-3.7.0/bin/../conf/zoo.cfg
Client port found: 2181. Client address: localhost. Client SSL: false.
Error contacting service. It is probably not running.
(2)查看ZooKeeper日志
[Hadoop@master ZooKeeper]$ zkServer.sh start-foreground
ZooKeeper JMX enabled by default
Using config: /home/Hadoop/ZooKeeper/zookeeper-3.7.0/bin/../conf/zoo.cfg
2021-11-02 00:53:27,801 [myid:] - INFO [main:QuorumPeerConfig@174] - Reading configuration from: /home/Hadoop/ZooKeeper/zookeeper-3.7.0/bin/../conf/zoo.cfg
2021-11-02 00:53:27,810 [myid:] - INFO [main:QuorumPeerConfig@444] - clientPortAddress is 0.0.0.0:2181
2021-11-02 00:53:27,810 [myid:] - INFO [main:QuorumPeerConfig@448] - secureClientPort is not set
2021-11-02 00:53:27,810 [myid:] - INFO [main:QuorumPeerConfig@464] - observerMasterPort is not set
2021-11-02 00:53:27,811 [myid:] - INFO [main:QuorumPeerConfig@481] - metricsProvider.className is org.apache.zookeeper.metrics.impl.DefaultMetricsProvider
2021-11-02 00:53:27,816 [myid:1] - INFO [main:DatadirCleanupManager@78] - autopurge.snapRetainCount set to 3
2021-11-02 00:53:27,816 [myid:1] - INFO [main:DatadirCleanupManager@79] - autopurge.purgeInterval set to 0
2021-11-02 00:53:27,817 [myid:1] - INFO [main:DatadirCleanupManager@101] - Purge task is not scheduled.
2021-11-02 00:53:27,818 [myid:1] - INFO [main:ManagedUtil@44] - Log4j 1.2 jmx support found and enabled.
2021-11-02 00:53:27,823 [myid:1] - INFO [main:QuorumPeerMain@152] - Starting quorum peer, myid=1
2021-11-02 00:53:27,830 [myid:1] - INFO [main:ServerMetrics@62] - ServerMetrics initialized with provider org.apache.zookeeper.metrics.impl.DefaultMetricsProvider@19dfb72a
2021-11-02 00:53:27,832 [myid:1] - INFO [main:DigestAuthenticationProvider@47] - ACL digest algorithm is: SHA1
2021-11-02 00:53:27,832 [myid:1] - INFO [main:DigestAuthenticationProvider@61] - zookeeper.DigestAuthenticationProvider.enabled = true
2021-11-02 00:53:27,835 [myid:1] - INFO [main:ServerCnxnFactory@169] - Using org.apache.zookeeper.server.NIOServerCnxnFactory as server connection factory
2021-11-02 00:53:27,836 [myid:1] - WARN [main:ServerCnxnFactory@309] - maxCnxns is not configured, using default value 0.
2021-11-02 00:53:27,837 [myid:1] - INFO [main:NIOServerCnxnFactory@652] - Configuring NIO connection handler with 10s sessionless connection timeout, 1 selector thread(s), 4 worker threads, and 64 kB direct buffers.
2021-11-02 00:53:27,841 [myid:1] - INFO [main:NIOServerCnxnFactory@660] - binding to port 0.0.0.0/0.0.0.0:2181
2021-11-02 00:53:27,842 [myid:1] - ERROR [main:QuorumPeerMain@114] - Unexpected exception, exiting abnormally
java.net.BindException: 地址已在使用
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:438)
at sun.nio.ch.Net.bind(Net.java:430)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:225)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:67)
at org.apache.zookeeper.server.NIOServerCnxnFactory.configure(NIOServerCnxnFactory.java:662)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.runFromConfig(QuorumPeerMain.java:169)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:137)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:91)
2021-11-02 00:53:27,843 [myid:1] - INFO [main:ZKAuditProvider@42] - ZooKeeper audit is disabled.
2021-11-02 00:53:27,844 [myid:1] - ERROR [main:ServiceUtils@42] - Exiting JVM with code 1
2、问题剖析
造成上述问题,其实笔者也不知道是什么原因导致的。
但是呢,在后来笔者耐心不断修改、不断测试中,意外地把Zookeeper配置搞对了。
但可以肯定的是,Zookeeper集群需要将至少三个节点都启动起来之后,才会运行正常。而且,主节点是随机选择的,不能指定。
3、解决方案
(1)参数文件要配正确;
(2)至少启动三个节点后,集群才会运行正常。重新查看各个节点的状态,在配置没有问题情况下,就会正常了。
注:后期笔者会将正确的配置晒出,当前没有时间进行整理。
ZooKeeper启动报错,未成功开启服务的更多相关文章
- zookeeper启动报错(数据目录权限不对)
zookeeper启动报错日志: 2016-11-16 11:19:43,880 [myid:3] - INFO [WorkerReceiver[myid=3]:FastLeaderElection@ ...
- zookeeper启动报错处理记录
zookeeper启动时正常,查看状态时出错 处理,通过 ./zkServer.sh status 报错Error contacting service. It is probably not run ...
- zookeeper启动报错:Error contacting service. It is probably not running
Error contacting service. It is probably not running. 今天启动zookeeper集群时,正常启动,但是查看状态时发现,Error contacti ...
- hbase安装 配置报错 zookeeper启动报错
zookeeper安装问题,使用独立安装的zookeeper export HBASE_MANAGES_ZK=false #如果使用独立安装的zookeeper这个地方就是false 创建zook ...
- ZooKeeper启动报错 JAVA_HOME is incorrectly set
解决办法:在zkEnv.cmd文件中直接写死调用的jdk路径 set JAVA_HOME="D:\Program Files\Java7\jdk1.7.0_51" if not e ...
- ZooKeeper启动报错:My id 3 not in the peer list
错误描述: 解决方法:查看zookeeper-3.4.2/conf目录下 编辑zoo.cfg文件 发现第三行有问题修改
- rabbitmq 启动报错
=============================================== 2017/10/24_第1次修改 ccb_warlock = ...
- SpringBoot注册Windows服务和启动报错的原因
SpringBoot注册Windows服务和启动报错的原因 Windows系统启动Java程序会弹出黑窗口.黑窗口有几点不好.首先它不美观:其次容易误点导致程序关闭:但最让我匪夷所思的是:将鼠标光标选 ...
- gitblit在windows10上的安装及服务启动报错处理
折腾一下午算是装好了,心情不错决定分享一下.安装步骤大同小异网上都有,主要是Failed creating java 这个报错,百度出来的没有一个能给我解决的,摸索半天找出一个自己的方式.为报错而来的 ...
- Tomcat7.0.40注册到服务启动报错error Code 1 +connector attribute sslcertificateFile must be defined when using ssl with apr
Tomcat7.0.40 注册到服务启动遇到以下几个问题: 1.启动报错errorCode1 查看日志如下图: 解决办法: 这个是因为我的jdk版本问题,因为电脑是64位,安装的jdk是32位的所以会 ...
随机推荐
- vvv,具名插槽
<!DOCTYPE html> <html> <head> <script src="a.js"></script> & ...
- tomcat多主多备
主服务器默认轮询,当主服务器全部挂了,就会访问备机backup,备机也默认轮询
- 手写简单call、apply、bind
1.call ~function(){ function call_1(context, ...args){ context = context == undefined ? window : con ...
- CSS3滤镜属性filter让网页变黑白
很多特殊的时候,我们向英雄们致敬,在互联网上最常见的方式就是整个网页变黑白,今天逛某博客收集一段代码,用于网页整体变黑白,用css3滤镜属性filter让网页马上变黑白,一行代码就搞定. 在你的css ...
- 整合mybatis实现简单的增删改查
mybatis配置相关代码 配置 <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE conf ...
- node.js请求css、js静态资源页面不生效
产生原因:文件响应头内容类型错误 解决方案:设置对应的响应头内容类型 const http = require('http'); const fs = require('fs'); const pat ...
- Morris遍历以及Morris前序中序后序遍历实现
#include<iostream> using namespace std; struct TreeNode{ int val; TreeNode* right; TreeNode* l ...
- CGTime CMTimeRange CMTimeMapping 小结
CMTime CMTimeRange CMTimeMapping 在使用 AVFoundation 框架处理多媒体资源时,通常会用到一些在 CoreMedia 框架中定义的结构体, 这里对其中描述时间 ...
- MySQL数据库架构&SQL注入漏洞
1.查找zblog数据库中有哪些表
- Postgresql统计所有表的基本信息(如行数、大小等)
目录 pg_class 记录表和几乎所有具有列或者像表的东西.这包括索引(但还要参见 pg_index ).序列.视图.物化视图.组合类型和TOAST表,参见 relkind .下面,当我们提及所有这 ...