为什么 kafka 无法在多节点结构网络上为订购者创建交付客户端?



我正在尝试在 2 台物理机器上安装 HLF (v2( 网络。 机器 1:

  • 1 排序者 2 同行 2 沙发数据库 2 动物园管理员 2 卡夫卡

机器 2:

1
  • 排序者 2 同行 2 沙发数据库 1 动物园管理员 2 卡夫卡

容器在两台计算机上运行。

但是,当我尝试在机器 1 上创建通道时

peer channel create -o orderer.example.com:7050 -c $CHANNEL_NAME -f ./channel-artifacts/channel.tx --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem

我收到此错误: 错误:无法为订购方创建交付客户端:订购方客户端无法连接到 orderer.example.com:7050:无法创建新连接:已超过上下文截止时间

docker logs orderer.example.com -f 

输出:

FO 00c [channel: byfn-sys-channel] Setting up the topic for this channel...
2020-06-09 20:10:31.316 UTC [orderer.consensus.kafka.sarama] Open -> DEBU 00d ClientID is the default of 'sarama', you should consider setting it to something application-specific.
2020-06-09 20:10:31.320 UTC [orderer.consensus.kafka.sarama] withRecover -> DEBU 00e Failed to connect to broker kafka0.example.com:9092: dial tcp 172.20.0.5:9092: connect: connection refused
2020-06-09 20:10:31.321 UTC [orderer.consensus.kafka.sarama] Open -> DEBU 00f ClientID is the default of 'sarama', you should consider setting it to something application-specific.
2020-06-09 20:10:31.323 UTC [orderer.consensus.kafka.sarama] withRecover -> DEBU 010 Failed to connect to broker kafka1.example.com:9092: dial tcp 172.20.0.9:9092: connect: connection refused
2020-06-09 20:10:31.323 UTC [orderer.consensus.kafka.sarama] Open -> DEBU 011 ClientID is the default of 'sarama', you should consider setting it to something application-specific.
2020-06-09 20:10:31.342 UTC [orderer.consensus.kafka.sarama] withRecover -> DEBU 012 Failed to connect to broker kafka2.example.com:9092: dial tcp: lookup kafka2.example.com on 127.0.0.11:53: no such host
2020-06-09 20:10:31.342 UTC [orderer.consensus.kafka.sarama] Open -> DEBU 013 ClientID is the default of 'sarama', you should consider setting it to something application-specific.
2020-06-09 20:10:31.355 UTC [orderer.consensus.kafka.sarama] withRecover -> DEBU 014 Failed to connect to broker kafka3.example.com:9092: dial tcp: lookup kafka3.example.com on 127.0.0.11:53: no such host
2020-06-09 20:10:36.355 UTC [orderer.consensus.kafka.sarama] Open -> DEBU 015 ClientID is the default of 'sarama', you should consider setting it to something application-specific.

您需要在 Sarama 中为每个消费者配置一个唯一的"clientid"。

Kafka有"消费者组"和"消费者"(又名clientid(的概念。 每个使用者在使用者组中必须具有唯一的 ID。Kafka 会将分区分配给使用者。Kafka 将使用消费者组跟踪所有消费者的偏移位置。

最新更新