I am creating a cluster of three zookeeper docker containers on a Single system. Admin server of the first zookeeper docker is up using port 8080, so for other two Zoo containers, it is giving "Failed to bind to /0.0.0.0:8080, address in use". I am using zoo version as "zookeeper:3.5.6".
Now my question is how to assign different admin port to the zookeeper admin server other than 8080?
I have tried different options to set the admin server on different ports, but nothing worked.
1) - zookeeper.admin.serverPort=8078
2) - ZOO_CFG_EXTRA="admin.serverPort=8077"
3) - admin.serverPort=8078
Below is the docker compose for one zookeeper.
zk2:
hostname: ${LOCAL_HOST}
image: ${ZOOKEEPER_IMAGE}
environment:
- u=${USER}:${USER}
- JVM_OPTS=-Xmx12g -Xms12g -XX:MaxPermSize=2048m
- ZOO_MY_ID=${ZOO_MY_ID2}
- ZOO_SERVERS=${ZOO_SERVER_1} ${ZOO_SERVER_2} ${ZOO_SERVER_3}
- ZOO_ADMINSERVER_ENABLED=true
- ZOO_STANDALONE_ENABLED=false
- zookeeper.admin.serverPort=8078
volumes:
- ${VOLUMES_PATH}/zk2/data:/data
- ${VOLUMES_PATH}/zk2/logs:/datalog
network_mode: "host"
ports:
- ${ZOOK_CL_PORT2}:${ZOOK_CL_PORT2}
- ${ZOOK_SR_PORT2}:${ZOOK_SR_PORT2}
- ${ZOOK_EL_PORT2}:${ZOOK_EL_PORT2}
- ${ZOOK_ADM_PORT2}:8078"
Can anyone suggest me how to do that?