尝试在多主机环境中通过kafka群集设置Hyperledger Fabric v1.0 orderers

时间:2017-12-11 14:38:20

标签: hyperledger-fabric hyperledger

我正在尝试设置Hyperledger Fabric v1.0,其中3个orderers连接到多个主机环境下的4个kafka节点,但我在orderer控制台发现错误" broker.go:96:无法连接到代理e13a106f3821:9092 :拨tcp:i / o timeout" 。贝娄是我的环境:
1.一个主机运行org1,1个orderer,4个kafka节点和3个zookeeper的对等体 2.一个主机运行org2,1 orrrer的同行

org1似乎正好相邻我在org2的orderer的控制台日志中看到了下面的错误

[sarama] 2017/12/12 06:11:52.186722 client.go:397: client/brokers registered new broker #0 at 33be78497375:9092
[sarama] 2017/12/12 06:11:52.186739 client.go:397: client/brokers registered new broker #1 at 2339e38eee34:9092
[sarama] 2017/12/12 06:11:52.186743 client.go:397: client/brokers registered new broker #2 at fa8269a66bdc:9092
[sarama] 2017/12/12 06:11:52.186746 client.go:397: client/brokers registered new broker #3 at b5a700af19de:9092
[sarama] 2017/12/12 06:11:52.186816 client.go:154: Successfully initialized new client
[sarama] 2017/12/12 06:11:52.187031 config.go:329: ClientID is the default of 'sarama', you should consider setting it to something application-specific.
[sarama] 2017/12/12 06:11:52.187256 async_producer.go:584: producer/broker/3 starting up
[sarama] 2017/12/12 06:11:52.187263 async_producer.go:596: producer/broker/3 state change to [open] on testchainid/0
[sarama] 2017/12/12 06:11:52.506396 broker.go:96: Failed to connect to broker b5a700af19de:9092: dial tcp: lookup b5a700af19de on 127.0.0.11:53: no such host
[sarama] 2017/12/12 06:11:52.506475 async_producer.go:762: producer/broker/3 state change to [closing] because dial tcp: lookup b5a700af19de on 127.0.0.11:53: no such host
[sarama] 2017/12/12 06:11:52.506505 async_producer.go:458: producer/leader/testchainid/0 state change to [retrying-1]
[sarama] 2017/12/12 06:11:52.506521 async_producer.go:468: producer/leader/testchainid/0 abandoning broker 3
[sarama] 2017/12/12 06:11:52.506546 async_producer.go:663: producer/broker/3 shut down
[sarama] 2017/12/12 06:11:52.606760 client.go:599: client/metadata fetching metadata for [testchainid] from broker kafka0:9092
[sarama] 2017/12/12 06:11:52.608799 config.go:329: ClientID is the default of 'sarama', you should consider setting it to something application-specific.
[sarama] 2017/12/12 06:11:52.609061 async_producer.go:584: producer/broker/3 starting up
[sarama] 2017/12/12 06:11:52.609085 async_producer.go:596: producer/broker/3 state change to [open] on testchainid/0
[sarama] 2017/12/12 06:11:52.609103 async_producer.go:446: producer/leader/testchainid/0 selected broker 3
[sarama] 2017/12/12 06:11:52.609119 async_producer.go:474: producer/leader/testchainid/0 state change to [flushing-1]
[sarama] 2017/12/12 06:11:52.609131 async_producer.go:496: producer/leader/testchainid/0 state change to [normal]
[sarama] 2017/12/12 06:11:52.923382 broker.go:96: Failed to connect to broker b5a700af19de:9092: dial tcp: lookup b5a700af19de on 127.0.0.11:53: no such host
[sarama] 2017/12/12 06:11:52.923406 async_producer.go:762: producer/broker/3 state change to [closing] because dial tcp: lookup b5a700af19de on 127.0.0.11:53: no such host
[sarama] 2017/12/12 06:11:52.923422 async_producer.go:458: producer/leader/testchainid/0 state change to [retrying-2]
[sarama] 2017/12/12 06:11:52.923426 async_producer.go:468: producer/leader/testchainid/0 abandoning broker 3
[sarama] 2017/12/12 06:11:52.923435 async_producer.go:663: producer/broker/3 shut down
[sarama] 2017/12/12 06:11:53.023826 client.go:599: client/metadata fetching metadata for [testchainid] from broker kafka0:9092
[sarama] 2017/12/12 06:11:53.026292 config.go:329: ClientID is the default of 'sarama', you should consider setting it to something application-specific.
[sarama] 2017/12/12 06:11:53.026574 async_producer.go:584: producer/broker/3 starting up
[sarama] 2017/12/12 06:11:53.026604 async_producer.go:596: producer/broker/3 state change to [open] on testchainid/0
[sarama] 2017/12/12 06:11:53.026622 async_producer.go:446: producer/leader/testchainid/0 selected broker 3
[sarama] 2017/12/12 06:11:53.026639 async_producer.go:474: producer/leader/testchainid/0 state change to [flushing-2]
[sarama] 2017/12/12 06:11:53.026651 async_producer.go:496: producer/leader/testchainid/0 state change to [normal]
[sarama] 2017/12/12 06:11:53.156478 broker.go:96: Failed to connect to broker b5a700af19de:9092: dial tcp: lookup b5a700af19de on 127.0.0.11:53: no such host
[sarama] 2017/12/12 06:11:53.156501 async_producer.go:762: producer/broker/3 state change to [closing] because dial tcp: lookup b5a700af19de on 127.0.0.11:53: no such host
[sarama] 2017/12/12 06:11:53.156518 async_producer.go:458: producer/leader/testchainid/0 state change to [retrying-3]
[sarama] 2017/12/12 06:11:53.156522 async_producer.go:468: producer/leader/testchainid/0 abandoning broker 3
[sarama] 2017/12/12 06:11:53.156531 async_producer.go:663: producer/broker/3 shut down
[sarama] 2017/12/12 06:11:53.256893 client.go:599: client/metadata fetching metadata for [testchainid] from broker kafka0:9092
[sarama] 2017/12/12 06:11:53.259126 config.go:329: ClientID is the default of 'sarama', you should consider setting it to something application-specific.
[sarama] 2017/12/12 06:11:53.259394 async_producer.go:584: producer/broker/3 starting up
[sarama] 2017/12/12 06:11:53.259405 async_producer.go:596: producer/broker/3 state change to [open] on testchainid/0
[sarama] 2017/12/12 06:11:53.259412 async_producer.go:446: producer/leader/testchainid/0 selected broker 3
[sarama] 2017/12/12 06:11:53.259417 async_producer.go:474: producer/leader/testchainid/0 state change to [flushing-3]
[sarama] 2017/12/12 06:11:53.259422 async_producer.go:496: producer/leader/testchainid/0 state change to [normal]
2017-12-12 06:11:53.381 UTC [orderer/kafka] try -> DEBU 160 [channel: testchainid] Retrying every 1s for a total of 30s
[sarama] 2017/12/12 06:11:53.381897 broker.go:96: Failed to connect to broker b5a700af19de:9092: dial tcp: lookup b5a700af19de on 127.0.0.11:53: no such host

看来orderer无法连接到kafka0或其他人。

有人请帮忙吗?

2 个答案:

答案 0 :(得分:0)

  

无法连接到代理商b5a700af19de:9092:拨打tcp:lookup   b5a700af19de在127.0.0.11:53:没有这样的主机

似乎DNS配置错误。你应该检查你的configtx.yaml或/ etc / hosts文件。

答案 1 :(得分:0)

确保正确执行以下操作。

  1. 已配置的Docker-Swarm
  2. 创建的网络
  3. 在Yaml中,您必须使用主机名而不是IP地址。
  4. 在运行Zookeeper和kafka容器时,请确保环境变量正确。
  5. -e“ ZOO_SERVERS = server.1 = zookeeper0:2888:3888 server.2 = zookeeper1:2888:3888 server.3 = zookeeper2:2888:3888”
  6. -e KAFKA_ZOOKEEPER_CONNECT = zookeeper0:2181,zookeeper1:2181,zookeeper2:2181