zookeeper3.5后啟動報端口被占

這是Zookeeper AdminServer,默認使用8080端口
需要在zoo.cfg 里設置admin.serverPort=8888
原文如下:https://www.cnblogs.com/boboooo/p/9242088.html
Zookeeper 3.5啟動時 8080端口被占用
今天閑來無事,學習Zookeeper,下載了Zookeeper的最新版本3.5。啟動以后顯示:
|
1
2
3
|
ZooKeeper JMX enabled by
default
Using config: /opt/zookeeper-
3.5
.
4
-beta/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
|
以為啟動成功,然后連接時報錯,查看后台進程,沒有Zookeeper進程。
查看zookeeper的日志文件:
|
1
2
|
2018
-
06
-
29
01
:
36
:
01
,
142
[myid:] - ERROR [main:ZooKeeperServerMain
@79
] - Unable to start AdminServer, exiting abnormally
org.apache.zookeeper.server.admin.AdminServer$AdminServerException: Problem starting AdminServer on address
0.0
.
0.0
, port
8080
and command URL /commands
|
發現8080端口被占用,通過查閱Zookeeper3.5的官方文檔,發現這是Zookeeper3.5的新特性:

這是Zookeeper AdminServer,默認使用8080端口,它的配置屬性如下:
我們可以修改在zoo.cfg中修改AdminServer的端口:
|
1
|
admin.serverPort=
8888
|
保存后,再次啟動,Zookeeper啟動成功。
