unAble to start adminServer zookeeper无法启动

本文涉及的产品
服务治理 MSE Sentinel/OpenSergo,Agent数量 不受限
云原生网关 MSE Higress,422元/月
注册配置 MSE Nacos/ZooKeeper,118元/月
简介: zookeeper无法启动

一. zk admin启动默认端口是8080,如果有其他服务在用8080,那启动时就报错了,端口已被绑定


2019-06-1610:40:29,724 [myid:] -ERROR [main:ZooKeeperServerMain@79] -UnabletostartAdminServer, exitingabnormallyorg.apache.zookeeper.server.admin.AdminServer$AdminServerException: ProblemstartingAdminServeronaddress0.0.0.0, port8080andcommandURL/commandsatorg.apache.zookeeper.server.admin.JettyAdminServer.start(JettyAdminServer.java:107)
atorg.apache.zookeeper.server.ZooKeeperServerMain.runFromConfig(ZooKeeperServerMain.java:138)
atorg.apache.zookeeper.server.ZooKeeperServerMain.initializeAndRun(ZooKeeperServerMain.java:106)
atorg.apache.zookeeper.server.ZooKeeperServerMain.main(ZooKeeperServerMain.java:64)
atorg.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:128)
atorg.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:82)
Causedby: java.io.IOException: Failedtobindto/0.0.0.0:8080atorg.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:346)
atorg.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:308)
atorg.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)
atorg.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:236)
atorg.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
atorg.eclipse.jetty.server.Server.doStart(Server.java:396)
atorg.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
atorg.apache.zookeeper.server.admin.JettyAdminServer.start(JettyAdminServer.java:103)
    ... 5moreCausedby: java.net.BindException: 地址已在使用atsun.nio.ch.Net.bind0(NativeMethod)
atsun.nio.ch.Net.bind(Net.java:433)
atsun.nio.ch.Net.bind(Net.java:425)
atsun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
atsun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
atorg.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:342)
    ... 12moreUnabletostartAdminServer, exitingabnormally


二. 这种情况下就去zoo.cfg文件中修改一下端口号,只要没有被其他程序占用的端口都可以


admin.serverPort=9099

'

三.对其他端口做一下补充


1、zookeeper有三个端口(可以修改)


1、2181
2、3888
3、2888


2、3个端口的作用


1、2181:对cline端提供服务
2、3888:选举leader使用
3、2888:集群内机器通讯使用(Leader监听此端口)



3、部署时注意


1、单机单实例,只要端口不被占用即可
2、单机伪集群(单机,部署多个实例),三个端口必须修改为组组不一样
如:myid1 : 2181,3888,2888
myid2 : 2182,3788,2788
myid3 : 2183,3688,2688
3、集群(一台机器部署一个实例)


4、集群为大于等于3个基数,如 3、5、7....,不宜太多,集群机器多了选举和数据同步耗时时长长,不稳定。目前觉得,三台选举+N台observe很不错。


相关实践学习
基于MSE实现微服务的全链路灰度
通过本场景的实验操作,您将了解并实现在线业务的微服务全链路灰度能力。
相关文章
|
消息中间件
RabbitMQ ha-promote-on-shutdown 与 ha-promote-on-failure
RabbitMQ ha-promote-on-shutdown 与 ha-promote-on-failure
112 0
|
6月前
|
监控 网络安全
zookeeper的日志报will be dropped if server is in r-o mode如何解决
【6月更文挑战第26天】zookeeper的日志报will be dropped if server is in r-o mode如何解决
223 2
|
6月前
|
监控 网络安全
zookeeper的日志报will be dropped if server is in r-o mode
【6月更文挑战第8天】zookeeper的日志报will be dropped if server is in r-o mode
146 6
|
6月前
|
监控 网络安全
zookeeper的日志报will be dropped if server is in r-o mode 问题
【6月更文挑战第13天】zookeeper的日志报will be dropped if server is in r-o mode 问题
191 1
|
6月前
|
Java
SpringBoot启动报错:Unable to start LiveReload server【已解决】
SpringBoot启动报错:Unable to start LiveReload server【已解决】
299 0
|
7月前
|
分布式计算 Hadoop
Zookeeper 启动失败【Cannot open channel to 3 at election address...】
解决Hadoop Zookeeper连接问题:检查Zookeeper目录权限,使用`sudo chown -R username:username /your_zookeeper_path`授权。确保`zoo.cfg`配置`quorumListenOnAllIPs=true`并监听所有IP。关键是机器ID(如`server.0`, `server.1`等)需与IP或主机名对应,修正`zoo.cfg`中的设置,例如`server.0=hadoop120:2888:3888`等。重启Zookeeper后,问题解决。
337 0
|
7月前
【已解决】ZooKeeper配置中出现Error contacting service. It is probably not running
【已解决】ZooKeeper配置中出现Error contacting service. It is probably not running
345 1
|
7月前
|
消息中间件 Java Kafka
【Kafka】Kafka-Server-start.sh 启动脚本分析(Ver 2.7.2)
【Kafka】Kafka-Server-start.sh 启动脚本分析(Ver 2.7.2)
139 0
|
应用服务中间件 Android开发
“Server Tomcat v9.0 Server at localhost was unable to start within 45 seconds“的解决方案
“Server Tomcat v9.0 Server at localhost was unable to start within 45 seconds“的解决方案
804 0
“Server Tomcat v9.0 Server at localhost was unable to start within 45 seconds“的解决方案
|
Java Linux 数据安全/隐私保护
成功解决ZooKeeper配置中出现Error contacting service. It is probably not running
成功解决ZooKeeper配置中出现Error contacting service. It is probably not running