Hyperledger Fabric 问题归档 - 构建多Org和多Peer环境集群遇到的问题

时间:2024-03-30 14:19:05

(持续更新)

 

2020/10/30

问题:获取系统区块失败

###############################################################
############### Have Org5 peers join network ##################
###############################################################

========= Getting Org on to your test network ========= 

Fetching channel config block from orderer...
+ peer channel fetch 0 mychannel.block -o orderer.example.com:7050 --ordererTLSHostnameOverride orderer.example.com -c mychannel --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
+ res=1
+ set +x
2020-10-30 04:00:17.840 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2020-10-30 04:00:17.843 UTC [cli.common] readBlock -> INFO 002 Expect block, but got status: &{FORBIDDEN}
Error: can't read the block: &{FORBIDDEN}
!!!!!!!!!!!!!!! Fetching config block from orderer has Failed !!!!!!!!!!!!!!!!

ERROR !!!! Unable to have Org3 peers join network

看代码,是addOrg3.sh调用OrgXCli的docker运行ste2org3.sh,出现获取系统区块错误,应该是环境配置出错

问题出现:

在addOrg3/docker/docker-compose-orgX.yaml

Hyperledger Fabric 问题归档 - 构建多Org和多Peer环境集群遇到的问题

29行CORE_PEER_ADDRESS出现一个右括号

问题根源:

由于我是用代码自动化构建,在构建函数中
 

Hyperledger Fabric 问题归档 - 构建多Org和多Peer环境集群遇到的问题

第9行,少了一个右括号。

有意思的是,在Org4Cli中不存在这个问题,也不知道是什么原因

然而执行程序,还是不行

进入Org5cli,发现结点没有加入channel,神秘。

Hyperledger Fabric 问题归档 - 构建多Org和多Peer环境集群遇到的问题

对比Org4的创建过程和Org5的创建过程,发现错误

========= Submitting transaction from a different peer (peer0.org2) which also signs it ========= 

Using organization 2 peer 0
peer0.org2.example.com:9051
+ set +x
+ peer channel update -f org5_update_in_envelope.pb -c mychannel -o orderer.example.com:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
2020-10-30 04:28:11.495 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
Error: got unexpected status: BAD_REQUEST -- error applying config update to existing channel 'mychannel': error authorizing update: error validating DeltaSet: policy for [Group]  /Channel/Application not satisfied: implicit policy evaluation failed - 2 sub-policies were satisfied, but this policy requires 3 of the 'Admins' sub-policies to be satisfied
事到如今只能瞎猜了,可能是需要大部分Org的Admin对结点加入的行为进行背书,但我不想那么麻烦,改成只需要任意Org的admin进行背书

Hyperledger Fabric 问题归档 - 构建多Org和多Peer环境集群遇到的问题

down,再up,org5成功加入。猜中了!