docker - 在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
对等点应该能够加入频道
解决方案
尝试在peer-base.yaml- GODEBUG=netdns=go
文件的 environment 部分添加,它可以在fabric-samples/first-newtork/base/中找到
这是一个众所周知的问题,简而言之,这是由于文件 resolv.conf 的更改导致的,Hyperledger Fabric 中的容器间域名解析从纯 Go 解析器切换到 cgo 解析器,由已知静态链接引起的 SIGSEGV 错误cgo 被触发,因此 Hyperledger Fabric 的部署失败。要了解更多信息,请点击此链接。
推荐阅读
- aws-appsync - App Sync Resolver 按时间戳按升序排序
- python - Python:如果“if”语句有两个条件,则“if”函数不起作用
- r - Tidyeval quo vs enquo
- macos - shell:检索 Finder 复制的文件的路径
- python - 检查 boost::python::tuple 的值为 None
- sas - 将 SAS 中的表加载到 Netezza
- swagger - ASP .NET WebAPI 和正确的路由
- assembly - 汇编 DB 指令和整数值
- javascript - JS confirm() 取消按钮仍然提交表单
- asp.net - 默认或自定义错误页面?- WebConfig 自定义错误 defaultRedirect