初心 - Zookeeper
type: channel
link: https://mayanpeng.cn/tag/Zookeeper/
items: Rancher部署zookeeper集群时，无法绑定请求地址

Rancher部署zookeeper集群时，无法绑定请求地址
type: item
date: 2022-07-11T14:04:00+08:00
description: Rancher部署zookeeper集群时，无法绑定请求地址错误提示 "Cannot assign requested address (Bind failed)"2022-07-11 03:28:24,363 [myid:1] - ERROR [zookeeper-node1/10.43.226.253:3888:QuorumCnxManager$Listener@958] - Exception while listening java.net.BindException: Cannot assign requested address (Bind failed) at java.base/java.net.PlainSocketImpl.socketBind(Native Method) at java.base/java.net.AbstractPlainSocketImpl.bind(Unknown Source) at java.base/java.net.ServerSocket.bind(Unknown Source) at java.base/java.net.ServerSocket.bind(Unknown Source) at org.apache.zookeeper.server.quorum.QuorumCnxManager$Listener.run(QuorumCnxManager.java:931)原因因为3888端口通过K8S服务暴露，需要添加配置项quorumListenOnAllIPs=true以保证扫描所有网卡解决通过环境变量添加配置项ZOO_CFG_EXTRA=“quorumListenOnAllIPs=true”