Hyperledger Fabric: Kafka can not establish a connection

0 votes

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)

Nov 9, 2018 in Blockchain by digger
• 27,630 points
348 views

1 answer to this question.

0 votes

Try this: 

kafka1.hyperfabric.xyz:
  image: hyperledger/fabric-kafka
  restart: always
  container_name: kafka1.hyperfabric.xyz
  environment:
    - KAFKA_PORT=10092
    - 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:10092
    - 10093:9093
answered Nov 9, 2018 by Omkar
• 67,380 points

Related Questions In Blockchain

0 votes
1 answer
0 votes
1 answer

Not Able to register a user with Hyperledger-Fabric v1.1 preview

The error: "Certificate not found with AKI 'e729224e8b3f31784c8a93c5b8ef6f4c1c91d9e6e577c45c33163609fe40011' ...READ MORE

answered Jun 16, 2018 in Blockchain by charlie_brown
• 7,720 points
388 views
0 votes
1 answer

Can a hyperledger composer work without fabric installed?

The pre-requisites section of hyperledger composer explains ...READ MORE

answered Jul 24, 2018 in Blockchain by digger
• 27,630 points
54 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Invalid Batch or signature in Savtooth

This will solve your problem import org.apache.commons.codec.binary.Hex; Transaction txn ...READ MORE

answered Aug 1, 2018 in Blockchain by digger
• 27,630 points
67 views
+1 vote
1 answer
0 votes
1 answer

Can not make a peer in Hyperledger Fabric

You have not installed jdk on your system. ...READ MORE

answered Nov 22, 2018 in Blockchain by Omkar
• 67,380 points
38 views
+2 votes
3 answers

Hyperledger Fabric: Peer Connection error: Failed obtaining connection: Could not connect to any of the endpoints.

 You can extend your /etc/hosts file and make orderer.example.com domain name ...READ MORE

answered Nov 13, 2018 in Blockchain by Omkar
• 67,380 points
814 views