環境
操作系統:CentOS 7
Fabric版本: 2.0.1
問題
創建通道時報錯(yaml文件已通過extra_hosts方式配置域名解析)
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
報錯:
Error: failed to create deliver client for orderer: orderer client failed to connect to orderer.example.com:7050: failed to create new connection: connection error: desc = “transport: error while dialing: dial tcp 192.168.1.20:7050: connect: no route to host”
解決方案:關閉防火牆
systemctl status firewalld.service #查看防火牆狀態
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall開機啓動
再次執行創建通道命令即可