Compose file:
version: '2'
services:
zookeeper0.hyperfabric.xyz:
image: hyperledger/fabric-zookeeper
restart: always
container_name: zookeeper0.hyperfabric.xyz
environment:
- ZOO_SERVERS=server.1=zookeeper0.hyperfabric.xyz:2888:3888
- ZOO_MY_ID=1
ports:
- 2181:2181
- 2888:2888
- 3888:3888
kafka0.hyperfabric.xyz:
image: hyperledger/fabric-kafka
restart: always
container_name: kafka0.hyperfabric.xyz
environment:
- KAFKA_MESSAGE_MAX_BYTES=103809024
- KAFKA_REPLICA_FETCH_MAX_BYTES=103809024
- KAFKA_UNCLEAN_LEADER_ELECTION_ENABLE=false
- KAFKA_MIN_INSYNC_REPLICAS=1
- KAFKA_DEFAULT_REPLICATION_FACTOR=1
- KAFKA_ZOOKEEPER_CONNECT=zookeeper0.hyperfabric.xyz:2181
- KAFKA_BROKER_ID=0
- KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://kafka0.hyperfabric.xyz:9092
ports:
- 9092:9092
- 9093:9093
Running this works fine.
When I introduce another broker using:
kafka1.hyperfabric.xyz:
image: hyperledger/fabric-kafka
restart: always
container_name: kafka1.hyperfabric.xyz
environment:
- KAFKA_MESSAGE_MAX_BYTES=103809024
- KAFKA_REPLICA_FETCH_MAX_BYTES=103809024
- KAFKA_UNCLEAN_LEADER_ELECTION_ENABLE=false
- KAFKA_MIN_INSYNC_REPLICAS=1
- KAFKA_DEFAULT_REPLICATION_FACTOR=1
- KAFKA_ZOOKEEPER_CONNECT=zookeeper0.hyperfabric.xyz:2181
- KAFKA_BROKER_ID=1
- KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://kafka1.hyperfabric.xyz:10092
ports:
- 10092:9092
- 10093:9093
I get the following error:
[2018-05-11 02:04:08,310] WARN [Controller id=0, targetBrokerId=1] Connection to node 1 could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient)