阿里云的多机环境配置其实与之前步骤是大同小异的
关键是出现了一些新的bug,大部分是网络的连接问题
新的hosts表
112.124.200.9 orderer.example.com
121.196.47.136 peer0.org1.example.com
101.37.247.39 peer0.org2.example.com
常用语句
查看所有镜像
docker images
查看所有容器
docker ps -a
删除所有容器
docker rm -f $(docker ps -aq)
docker rmi -f $(docker images |grep "dev-" |awk '{print $3}')
开启所有容器
docker start $(docker ps -a | awk '{ print $1}' | tail -n +2)
e2e目录
cd /root/go/src/github.com/hyperledger/fabric/examples/e2e_cli
遇到的问题
1.fatal error: unexpected signal during runtime execution
修改自己阿里云ecs机器里面的 /etc/resolv.conf,把里面的 options timeout:2 attempts:3 rotate single-request-reopen 这一行内容注释掉
参考:问题1
2.FirewallD is not running
没开防火墙
开启防火墙
systemctl start firewalld
查看防火墙状态
systemctl status firewalld
3.Creating network "e2ecli_default" with the default driver ERROR: Failed to Setup IP tables: Unable to enable SKIP DNAT rule: (iptables failed: iptables --wait -t nat -I DOCKER -i br-e72e65c4ba22 -j RETURN: iptables: No chain/target/match by that name. (exit status 1))
(记忆中的解决方案)
安装iptables
yum install iptables-services
开启iptables
systemctl enable iptables
关闭iptables
systemctl stop iptables
4.关闭防火墙后docker需要重启(?也许是阿里云的独特操作,防火墙是开着的)
service docker restart
5.Failed to dial orderer.example.com:7050: connection error: desc = "transport authentication handshake failed: x509: certificate signed by unknown authori
证书乱了,重新生成证书并分配
./generateArtifacts.sh mychannel
删除之前的证书,删除crypto-config文件夹,channel-artifacts文件夹。注意channel-artifacts文件夹中要保留gensis文件
rm -rf crypto-config
rm -rf channel-artifacts
6.报错在创建通道的地方,报错信息没保存,大概意思是端口不通,grpc连接失败。
查看每个机子上的端口也都是开着的。问题的关键就是阿里云管理的地方也要开这几个端口,只在虚拟机里开实际上还是联通不了
以上步骤完成后,阿里云上的多机环境搭建成功