今天閑來無事混槐,學(xué)習(xí)Zookeeper,下載了Zookeeper的最新版本3.5轩性。啟動以后顯示:
ZooKeeper JMX enabled by default
Using config: /opt/zookeeper-3.5.4-beta/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
以為啟動成功声登,然后連接時報(bào)錯,查看后臺進(jìn)程揣苏,沒有Zookeeper進(jìn)程悯嗓。
查看zookeeper的日志文件:
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
發(fā)現(xiàn)8080端口被占用,通過查閱Zookeeper3.5的官方文檔卸察,發(fā)現(xiàn)這是Zookeeper3.5的新特性:
這是Zookeeper AdminServer脯厨,默認(rèn)使用8080端口,它的配置屬性如下:
我們可以修改在zoo.cfg中修改AdminServer的端口:
admin.serverPort=8888
保存后坑质,再次啟動合武,Zookeeper啟動成功。