多机多节点部署踩坑问题(亲身经历):
(一)项目环境
多机多节点指多台电脑上部署多个组织和节点,本案例部署一个排序(orderer)服务,两个组织(org1,org2)和四个节点(peer),每个组织包括两个节点,需要三台服务器,规划如下:
orderer.example.com 101.201.253.208
peer0.org1.example.com 123.56.48.16
peer1.org1.example.com 123.56.48.16
peer0.org2.example.com 39.96.115.136
peer1.org2.example.com 39.96.115.136
(二)问题描述与解决方案
踩坑1:
Error: failed to create deliver client :orderer client failed to
connect to orderer.example.com:7050: failed to create new connection:
context deadline exceeded
解决办法
检查配置文件是否正确,节点是否正常启动,前两者都正常去阿里云服务器将7050端口配置到安全组,此处我的问题是没有配置端口到安全组
踩坑2:
Error: channel create configuration tx file not found open ./channel-artifacts/channel.tx: no such file or directory
解决办法
首先查看路径是否错误,若没有查看testchannel.block文件是否生成,此处我的错误未生成testchannel.tx文件,重新生成通道文件
踩坑3:
Error: could not assemble transaction, err proposal response was not
successful, error code 500, msg error starting container: error
starting container: API error (404): network _byfn not found
解决办法
未配置网络名test_byfn,默认为空
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=test_byfn
踩坑4:
Error: error endorsing chaincode: rpc error: code = Unknown desc =
access denied: channel [testchannel] creator org [Org1MSP]
解决办法
首先查看配置msp文件是否错误,若没有重新down掉网络再加入通道一遍
踩坑5:
Error: could not assemble transaction, err proposal response was not
successful, error code 500, msg cannot get package for chaincode
(mycc:1.0)
解决办法
peer节点未配置 - peer0.org2.example.com:/var/hyperledger/production
踩坑6:
Error: error getting endorser client for channel: endorser client
failed to connect to peer0.org1.example.com:7051: failed to create new
connection: context deadline exceeded
解决办法
检查配置文件是否正确,节点是否正常启动,前两者都正常到 阿里云服务器配置7051端口,我的问题是配置文件出问题。