首页 > 解决方案 > 在fabric first-network示例中,热修复错误:“传输:拨号时出错:拨号tcp:lookup peer0.org1.example.com:没有这样的主机”

问题描述

无法运行结构优先网络示例

这是我运行时的日志:./byfn up


/ ___|  |_   _|    / \    |  _ \  |_   _|
\___ \    | |     / _ \   | |_) |   | |  
 ___) |   | |    / ___ \  |  _ <    | |  
|____/    |_|   /_/   \_\ |_| \_\   |_|  

Build your first network (BYFN) end-to-end test

Channel name : mychannel
Creating channel...
+ peer channel create -o orderer.example.com:7050 -c mychannel -f ./channel-artifacts/channel.tx --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
+ res=0
+ set +x
2019-06-27 22:22:11.117 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2019-06-27 22:22:12.361 UTC [cli.common] readBlock -> INFO 002 Received block: 0
===================== Channel 'mychannel' created ===================== 

Having all peers join the channel...
+ peer channel join -b mychannel.block
+ res=1
+ set +x
Error: error getting endorser client for channel: endorser client failed to connect to peer0.org1.example.com:7051: failed to create new connection: connection error: desc = "transport: error while dialing: dial tcp: lookup peer0.org1.example.com: no such host"
peer0.org1 failed to join the channel, Retry after 9 seconds

我的环境:

Ubuntu 18.04
Docker version 18.06.1-ce, build e68fc7a
docker-compose version 1.24.0, build 0aa59064
go version go1.11.11 linux/amd64

echo $GOPATH results in /usr/local/go/bin

对等点应该能够加入频道

标签: dockerhyperledger-fabric

解决方案


尝试在peer-base.yaml- GODEBUG=netdns=go文件的 environment 部分添加,它可以在fabric-samples/first-newtork/base/中找到

这是一个众所周知的问题,简而言之,这是由于文件 resolv.conf 的更改导致的,Hyperledger Fabric 中的容器间域名解析从纯 Go 解析器切换到 cgo 解析器,由已知静态链接引起的 SIGSEGV 错误cgo 被触发,因此 Hyperledger Fabric 的部署失败。要了解更多信息,请点击此链接


推荐阅读