新的RAFT订购者无法检测到它属于某个应用程序频道

时间:2019-05-09 10:16:18

标签: hyperledger-fabric

我的初始Hyperledger Fabric网络如下:

initial network

org1.example.com有2个RAFT节点。系统通道名称为system-channel(仅定义了1个联盟)。应用程序通道名称为channel1,其中org1.example.com的对等方运行chaincode1。请注意,没有单独的订购者组织。

系统频道配置文件为:

    OrdererGenesis:
        <<: *ChannelDefaults
        Orderer:
            <<: *OrdererDefaults
            Organizations:
                - *Org1
        Consortiums:
            SampleConsortium:
                Organizations:
                    - *Org1

我想添加另一个组织org2.example.com,以便最终的网络为:

Final network

我为system-channel采取的步骤(我遵循了https://hyperledger-fabric.readthedocs.io/en/release-1.4/raft_configuration.html#reconfiguration):

  1. Org2MSP中的订购者渠道组添加system-channel定义
  2. Org2MSP的Consortium渠道组中添加system-channel定义
  3. 将Org2的订购者信息(tls证书等)添加到同意者列表,即channel_group.groups.Orderer.values.ConsensusType.value.metadata.consenters中的system-channel
  4. 启动Org2的订购者,即orderer0.org2.example.com
  5. 将orderer0.org2.example.com添加到system-channel(即.channel_group.values.OrdererAddresses.value.addresses)中的订购者地址列表中

以上所有步骤均运作良好,orderer0.org2.example.com服务system-channel

继续,我为channel1采取的步骤:

  1. Org2MSP中的订购者渠道组添加channel1定义
  2. Org2MSP中的应用程序通道组添加channel1定义
  3. orderer0.org2.example.com添加到channel1中的订购者地址列表中,即.channel_group.values.OrdererAddresses.value.addresses
  4. orderer0.org2.example.com的信息(tls证书等)添加到同意者列表,即channel_group.groups.Orderer.values.ConsensusType.value.metadata.consenters中的channel1

直到步骤3,一切正常。完成第4步后,我开始在新添加的订购者channel1 does not exist中看到orderer0.org2.example.com错误:

2019-05-09 09:38:03.360 UTC [comm.grpc.server] 1 -> INFO 05a streaming call completed grpc.service=orderer.Cluster grpc.method=Step grpc.peer_address=192.168.224.6:43116 grpc.peer_subject="CN=orderer0.org1.example.com,OU=peer+OU=org1,O=org1.example.com,L=Singapore,ST=Singapore,C=SG" error="channel channel1 doesn't exist" grpc.code=Unknown grpc.call_duration=711.5µs

在当前的RAFT负责人中,也有错误消息(3表示orderer0.org2.example.com

2019-05-09 09:38:02.859 UTC [orderer.consensus.etcdraft] logSendFailure -> ERRO 0c5 Failed to send StepRequest to 3, because: aborted channel=channel1 node=1

似乎orderer0.org2.example.com不知道它应该为channel1服务。我也看不到channel1的{​​{1}}中的/var/hyperledger/production/orderer/chains文件夹

作为故障排除的一部分,我尝试保留所有包含链的订购者的orderer0.org2.example.com文件夹。关闭/var/hyperledger/production/ordererorderer0.org1.example.com,并将orderer0.org2.example.com文件夹从channel1复制到orderer0.org1.example.com,最后启动两个订购者。

Copy ledger manually

现在orderer0.org2.example.com知道它需要为orderer0.org2.example.com提供服务,如日志所证明的那样

channel1

基于上述内容,很明显2019-05-10 02:36:04.161 UTC [orderer.consensus.etcdraft] apply -> INFO 044 Applied config change to add node 1, current nodes in channel: [1] channel=channel1 node=3 2019-05-10 02:36:04.161 UTC [orderer.consensus.etcdraft] apply -> INFO 045 Applied config change to add node 2, current nodes in channel: [1 2] channel=channel1 node=3 2019-05-10 02:36:04.161 UTC [orderer.consensus.etcdraft] writeBlock -> INFO 046 Got block [6], expect block [7], this node was forced to catch up channel=channel1 node=3 2019-05-10 02:36:04.161 UTC [orderer.consensus.etcdraft] apply -> INFO 047 Applied config change to add node 3, current nodes in channel: [1 2 3] channel=channel1 node=3 无法接收orderer0.org2.example,com的块来开始为频道提供服务。对于同级,同级可以接收该阻止并发出channel1,但订购者不能这样做。我想知道我要走哪一步。

要模拟环境并重现问题,请参阅:https://github.com/aldredb/bring-your-own-orderer

1 个答案:

答案 0 :(得分:0)

此问题已解决。问题是我没有使用最新的配置块作为新订购者orderer0.org2.example.com中的引导块。完成上述操作后,orderer0.org2.example.com就可以检测到channel1

2019-05-10 14:06:04.778 UTC [orderer.common.server] replicateDisabledChains -> INFO 072 Successfully replicated 0 chains: []
2019-05-10 14:06:44.680 UTC [orderer.common.server] replicateDisabledChains -> INFO 073 Found 1 inactive chains: [channel1]
2019-05-10 14:06:44.689 UTC [orderer.common.cluster] ReplicateChains -> INFO 074 Will now replicate chains [channel1]