gpt4 book ai didi

docker - Hyperledger Fabric 对等容器无法与 couchdb 容器通信

转载 作者:行者123 更新时间:2023-12-02 18:22:28 24 4
gpt4 key购买 nike

我正在尝试配置 hyperledger fabric 网络。我经营着三个动物园管理员、三个卡夫卡、三个订购者和一个 couchdb。它们是 docker 容器并且运行良好。所有容器都在同一个名为 ibknet 的 docker 网络中。之后,我运行 peer container 但它在启动时检测 couchdb 容器时遇到问题。这是我运行对等容器的命令。

docker run -d --name main.stock.ibk.com --hostname main.stock.ibk.com\
-p 7051:7051\
-p 7053:7053\
-e CORE_LEDGER_STATE_STATEDATABASE=CouchDB\
-e CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb0:5984\
--network ibknet hyperledger/fabric-peer:x86_64-1.0.4

这是执行上述命令之前正在运行的 docker 容器的列表。

0b49e1d9e135        hyperledger/fabric-couchdb:x86_64-1.0.4     "tini -- /docker-e..."   28 minutes ago      Up 28 minutes               4369/tcp, 5984/tcp, 9100/tcp   couchdb0
592e81a721f1 hyperledger/fabric-orderer:x86_64-1.0.4 "orderer" 28 minutes ago Up 28 minutes 0.0.0.0:9050->7050/tcp orderer2
5a0d0f05770d hyperledger/fabric-orderer:x86_64-1.0.4 "orderer" 28 minutes ago Up 28 minutes 0.0.0.0:8050->7050/tcp orderer1
681894ae835a hyperledger/fabric-orderer:x86_64-1.0.4 "orderer" 28 minutes ago Up 28 minutes 0.0.0.0:7050->7050/tcp orderer0
2c1910c3e293 hyperledger/fabric-kafka:x86_64-1.0.4 "/docker-entrypoin..." 28 minutes ago Up 28 minutes 9092-9093/tcp kafka2
b27ff82abd3d hyperledger/fabric-kafka:x86_64-1.0.4 "/docker-entrypoin..." 29 minutes ago Up 28 minutes 9092-9093/tcp kafka1
2f84d000c2d6 hyperledger/fabric-kafka:x86_64-1.0.4 "/docker-entrypoin..." 29 minutes ago Up 28 minutes 9092-9093/tcp kafka0
25438ef57579 hyperledger/fabric-zookeeper:x86_64-1.0.4 "/docker-entrypoin..." 29 minutes ago Up 29 minutes 2181/tcp, 2888/tcp, 3888/tcp zookeeper2
c01262ae099e hyperledger/fabric-zookeeper:x86_64-1.0.4 "/docker-entrypoin..." 29 minutes ago Up 29 minutes 2181/tcp, 2888/tcp, 3888/tcp zookeeper1
f95e92b10b25 hyperledger/fabric-zookeeper:x86_64-1.0.4 "/docker-entrypoin..." 29 minutes ago Up 29 minutes 2181/tcp, 2888/tcp, 3888/tcp zookeeper0

当我运行对等容器时,我在 docker 日志中收到了这个错误消息。

2017-12-01 07:26:34.238 UTC [ledgermgmt] initialize -> INFO 002 Initializing ledger mgmt
2017-12-01 07:26:34.238 UTC [kvledger] NewProvider -> INFO 003 Initializing ledger provider
2017-12-01 07:26:34.624 UTC [couchdb] handleRequest -> WARN 004 Retrying couchdb request in 125ms. Attempt:1 Error:Get http://couchdb0:5984/: dial tcp 75.126.101.240:5984: getsockopt: connection refused
2017-12-01 07:26:34.987 UTC [couchdb] handleRequest -> WARN 005 Retrying couchdb request in 250ms. Attempt:2 Error:Get http://couchdb0:5984/: dial tcp 75.126.101.240:5984: getsockopt: connection refused
2017-12-01 07:26:35.533 UTC [couchdb] handleRequest -> WARN 006 Retrying couchdb request in 500ms. Attempt:3 Error:Get http://couchdb0:5984/: dial tcp 75.126.101.240:5984: getsockopt: connection refused
2017-12-01 07:26:36.279 UTC [couchdb] handleRequest -> WARN 007 Retrying couchdb request in 1s. Attempt:4 Error:Get http://couchdb0:5984/: dial tcp 75.126.101.240:5984: getsockopt: connection refused
2017-12-01 07:26:37.617 UTC [couchdb] handleRequest -> WARN 008 Retrying couchdb request in 2s. Attempt:5 Error:Get http://couchdb0:5984/: dial tcp 75.126.101.240:5984: getsockopt: connection refused
2017-12-01 07:26:39.819 UTC [couchdb] handleRequest -> WARN 009 Retrying couchdb request in 4s. Attempt:6 Error:Get http://couchdb0:5984/: dial tcp 75.126.101.240:5984: getsockopt: connection refused
2017-12-01 07:26:44.019 UTC [couchdb] handleRequest -> WARN 00a Retrying couchdb request in 8s. Attempt:7 Error:Get http://couchdb0:5984/: dial tcp 75.126.101.240:5984: getsockopt: connection refused
2017-12-01 07:26:52.279 UTC [couchdb] handleRequest -> WARN 00b Retrying couchdb request in 16s. Attempt:8 Error:Get http://couchdb0:5984/: dial tcp 75.126.101.240:5984: getsockopt: connection refused
2017-12-01 07:27:08.515 UTC [couchdb] handleRequest -> WARN 00c Retrying couchdb request in 32s. Attempt:9 Error:Get http://couchdb0:5984/: dial tcp 75.126.101.240:5984: getsockopt: connection refused
2017-12-01 07:27:40.730 UTC [couchdb] handleRequest -> WARN 00d Retrying couchdb request in 1m4s. Attempt:10 Error:Get http://couchdb0:5984/: dial tcp 75.126.101.240:5984: getsockopt: connection refused
panic: Error in instantiating ledger provider: Unable to connect to CouchDB, check the hostname and port: Get http://couchdb0:5984/: dial tcp 75.126.101.240:5984: getsockopt: connection refused

我错过了什么?我不知道 75.126.101.240 地址来自哪里。

实际上,我可以通过准确地提及 ip 来使用 --add-host 选项成功运行它。但我认为这不是正确的方法,因为每当我启动 docker 服务器时 ip 都会发生变化。

请帮忙解决这个问题。谢谢。

最佳答案

尝试添加:“--dns-search。”到 docker run 命令。您主机系统上的解析器可能配置为附加/搜索未知主机的域。 “--dns 搜索。”应该只通过嵌入式 Docker DNS 强制解析

关于docker - Hyperledger Fabric 对等容器无法与 couchdb 容器通信,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47588680/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com