Zookeeper打开了额外的随机高端口

问题描述

我看到在每个节点上,zookeeper打开了一个随机的高端口,该端口正在所有接口上进行侦听。如何禁用它?

这是我的zoo.cfg文件

# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial 
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between 
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
dataDir=/var/lib/zookeeper
# Place the dataLogDir to a separate physical disc for better performance
# dataLogDir=/disk2/zookeeper

admin.enableServer=false
autopurge.snapRetainCount=3
autopurge.purgeInterval=1
standaloneEnabled=false

# the port at which the clients will connect
clientPort=2181
clientPortAddress=192.168.0.102

# specify all zookeeper servers
# The fist port is used by followers to connect to the leader
# The second one is used for leader election
server.1=192.168.0.101:2888:3888
server.2=192.168.0.102:2888:3888
server.3=192.168.0.10:2888:3888


snapCount=100000

这是netstat显示的内容:

tcp6       0      0 192.168.0.102:3888      :::*                    LISTEN      21444/java              
tcp6       0      0 :::42433                :::*                    LISTEN      21444/java          
tcp6       0      0 192.168.0.102:2181      :::*                    LISTEN      21444/java     

由于Zookeeper启动后我不知道将选择哪个端口,因此无法对其进行防火墙。

Zookeeper版本为:3.6.2

解决方法

我一直在寻找相同的东西,并在这里获得了一些信息。

http://zookeeper-user.578899.n2.nabble.com/Zookeeper-listening-to-ports-other-than-clientPort-and-server-x-ports-td7580137.html

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...