2020年12月9日星期三

Zookeeper3.5及以上启动时8080端口被占用

今天闲来无事,学习Zookeeper,下载了Zookeeper的最新版本3.5。启动以后显示:

ZooKeeper JMX enabled by defaultUsing config: /opt/zookeeper-3.5.4-beta/bin/../conf/zoo.cfgStarting zookeeper ... STARTED

以为启动成功,然后连接时报错,查看后台进程,没有Zookeeper进程。

查看zookeeper的日志文件:

2018-06-29 01:36:01,142 [myid:] - ERROR [main:ZooKeeperServerMain@79] - Unable to start AdminServer, exiting abnormallyorg.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的新特性:

The AdminServerNew in 3.5.0: The AdminServer is an embedded Jetty server that provides an HTTP interface to the four letter word commands. By default, the server is started on port 8080, and commands are issued by going to the URL "/commands/[command name]", e.g., The command response is returned as JSON. Unlike the original protocol, commands are not restricted to four-letter names, and commands can have multiple names; for instance, "stmk" can also be referred to as "set_trace_mask". To view a list of all available commands, point a browser to the URL /commands (e.g., See the AdminServer configuration options for how to change the port and URLs.

这是Zookeeper AdminServer,默认使用8080端口,它的配置属性如下:

New in 3.5.0: The following options are used to configure the AdminServer.admin.enableServer : (Java system property: zookeeper.admin.enableServer) Set to "false" to disable the AdminServer. By default the AdminServer is enabled.admin.serverAddress : (Java system property: zookeeper.admin.serverAddress) The address the embedded Jetty server listens on. Defaults to 0.0.0.0.admin.serverPort : (Java system property: zookeeper.admin.serverPort) The port the embedded Jetty server listens on. Defaults to 8080.admin.idleTimeout : (Java system property: zookeeper.admin.idleTimeout) Set the maximum idle time in milliseconds that a connection can wait before sending or receiving data. Defaults to 30000 ms.admin.commandURL : (Java system property: zookeeper.admin.commandURL) The URL for listing and issuing commands relative to the root URL. Defaults to "/commands".

我们可以修改在zoo.cfg中修改AdminServer的端口:

admin.serverPort=8888

保存后,再次启动,Zookeeper启动成功。

站在巨人肩膀上摘苹果

https://www.cnblogs.com/boboooo/p/9242088.html

https://zookeeper.apache.org/doc/r3.6.2/zookeeperAdmin.html









原文转载:http://www.shaoqun.com/a/497462.html

picitup:https://www.ikjzd.com/w/446

亚马逊全球开店制造:https://www.ikjzd.com/w/204.html

c88:https://www.ikjzd.com/w/1017


今天闲来无事,学习Zookeeper,下载了Zookeeper的最新版本3.5。启动以后显示:ZooKeeperJMXenabledbydefaultUsingconfig:/opt/zookeeper-3.5.4-beta/bin/../conf/zoo.cfgStartingzookeeper...STARTED以为启动成功,然后连接时报错,查看后台进程,没有Zookeeper进程。查看zoo
打折网站:打折网站
topia:topia
日本东京旅游的出行须知有哪些?:日本东京旅游的出行须知有哪些?
从平湖广场到银湖汽车站怎么走?有多远?:从平湖广场到银湖汽车站怎么走?有多远?
跨境快讯:中国将建立"不可靠实体清单"制度,法国电商增长迅猛!:跨境快讯:中国将建立"不可靠实体清单"制度,法国电商增长迅猛!

没有评论:

发表评论

跨境电商资讯:外贸宣传平台有哪些(出口的

现在很多做外贸的人都非常关注 外贸企业怎么推广 ,而现在推广的途径和平台有很多,企业如果都做,成本和时间精力是一个问题,而且并不是所有的推广渠道都是有用的。今天云程网络就来为大家盘点几个有效的外贸推广渠道。 一、海外社交媒体营销 Facebook,领英等海外社交媒体营销在近几年得...