环境
操作系统: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开机启动
再次执行创建通道命令即可