尝试更新 Anchor Peer 时出现错误 SERVICE_UNAVILABLE

问题描述

当我运行代码 peer channel fetch config config_block.pb -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 -c mychannel

我收到了

2021-07-26 12:42:59.856 UTC [cli.common] readBlock -> INFO 002 Expect 阻止,但获得状态:&{SERVICE_UNAVAILABLE}

添加更多订购者后,我开始收到此错误。我正在使用 Raft 进行排序服务。以及用于生成证书的fabric-ca

configtx.yaml:

  Orderer: &OrdererDefaults # Orderer Type: The orderer implementation to start
  OrdererType: etcdraft

  # Addresses used to be the list of orderer addresses that clients and peers
  # Could connect to.  However,this does not allow clients to associate orderer
  # addresses and orderer organizations which can be useful for things such
  # as TLS validation.  The preferred way to specify orderer addresses is Now
  # to include the OrdererEndpoints item in your org deFinition
  Addresses:
    - orderer.example.com:7050
    - orderer2.example.com:8050
    - orderer3.example.com:9050

  EtcdRaft:
    Consenters:
      - Host: orderer.example.com
        Port: 7050
        ClientTLSCert: ../organizations/ordererOrganizations/example.com/orderers/orderer.example.com/tls/server.crt
        ServerTLSCert: ../organizations/ordererOrganizations/example.com/orderers/orderer.example.com/tls/server.crt
      - Host: orderer2.example.com
        Port: 8050
        ClientTLSCert: ../organizations/ordererOrganizations/example.com/orderers/orderer2.example.com/tls/server.crt
        ServerTLSCert: ../organizations/ordererOrganizations/example.com/orderers/orderer2.example.com/tls/server.crt
      - Host: orderer3.example.com
        Port: 9050
        ClientTLSCert: ../organizations/ordererOrganizations/example.com/orderers/orderer3.example.com/tls/server.crt
        ServerTLSCert: ../organizations/ordererOrganizations/example.com/orderers/orderer3.example.com/tls/server.crt

    # Options to be specified for all the etcd/raft nodes. The values here
    # are the defaults for all new channels and can be modified on a
    # per-channel basis via configuration updates.
    Options:
      # TickInterval is the time interval between two Node.Tick invocations.
      TickInterval: 500ms

      # ElectionTick is the number of Node.Tick invocations that must pass
      # between elections. That is,if a follower does not receive any
      # message from the leader of current term before ElectionTick has
      # elapsed,it will become candidate and start an election.
      # ElectionTick must be greater than HeartbeatTick.
      ElectionTick: 10

      # HeartbeatTick is the number of Node.Tick invocations that must
      # pass between heartbeats. That is,a leader sends heartbeat
      # messages to maintain its leadership every HeartbeatTick ticks.
      HeartbeatTick: 1

      # MaxInflightBlocks limits the max number of in-flight append messages
      # during optimistic replication phase.
      MaxInflightBlocks: 5

      # SnapshotIntervalSize defines number of bytes per which a snapshot is taken
      SnapshotIntervalSize: 16 MB

  # Batch Timeout: The amount of time to wait before creating a batch
  BatchTimeout: 2s

  # Batch Size: Controls the number of messages batched into a block
  BatchSize:
    # Max Message Count: The maximum number of messages to permit in a batch
    MaxMessageCount: 10

    # Absolute Max Bytes: The absolute maximum number of bytes allowed for
    # the serialized messages in a batch.
    AbsoluteMaxBytes: 99 MB

    # Preferred Max Bytes: The preferred maximum number of bytes allowed for
    # the serialized messages in a batch. A message larger than the preferred
    # max bytes will result in a batch larger than preferred max bytes.
    PreferredMaxBytes: 512 KB

  # Organizations is the list of orgs which are defined as participants on
  # the orderer side of the network
  Organizations:

  # Policies defines the set of policies at this level of the config tree
  # For Orderer policies,their canonical path is
  #   /Channel/Orderer/<PolicyName>
  Policies:
    Readers:
      Type: ImplicitMeta
      Rule: "ANY Readers"
    Writers:
      Type: ImplicitMeta
      Rule: "ANY Writers"
    Admins:
      Type: ImplicitMeta
      Rule: "MAJORITY Admins"
    # BlockValidation specifies what signatures must be included in the block
    # from the orderer for the peer to validate it.
    BlockValidation:
      Type: ImplicitMeta
      Rule: "ANY Writers"

docker-compose-file:

services:
  orderer.example.com:
    container_name: orderer.example.com
    image: hyperledger/fabric-orderer:latest
    labels:
      service: hyperledger-fabric
    environment:
      # - FABRIC_LOGGING_SPEC=INFO
      - FABRIC_LOGGING_SPEC=DEBUG
      - ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
      - ORDERER_GENERAL_LISTENPORT=7050
      - ORDERER_GENERAL_LOCALMSPID=OrdererMSP
      - ORDERER_GENERAL_LOCALMSPDIR=/var/hyperledger/orderer/msp
      # enabled TLS
      - ORDERER_GENERAL_TLS_ENABLED=true
      - ORDERER_GENERAL_TLS_PRIVATEKEY=/var/hyperledger/orderer/tls/server.key
      - ORDERER_GENERAL_TLS_CERTIFICATE=/var/hyperledger/orderer/tls/server.crt
      - ORDERER_GENERAL_TLS_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]
      - ORDERER_KAFKA_TOPIC_REPLICATIONFACTOR=1
      - ORDERER_KAFKA_VERBOSE=true
      - ORDERER_GENERAL_CLUSTER_CLIENTCERTIFICATE=/var/hyperledger/orderer/tls/server.crt
      - ORDERER_GENERAL_CLUSTER_CLIENTPRIVATEKEY=/var/hyperledger/orderer/tls/server.key
      - ORDERER_GENERAL_CLUSTER_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]
      - ORDERER_GENERAL_BOOTSTRAPMETHOD=none
      - ORDERER_CHANNELPARTICIPATION_ENABLED=true
      - ORDERER_ADMIN_TLS_ENABLED=true
      - ORDERER_ADMIN_TLS_CERTIFICATE=/var/hyperledger/orderer/tls/server.crt
      - ORDERER_ADMIN_TLS_PRIVATEKEY=/var/hyperledger/orderer/tls/server.key
      - ORDERER_ADMIN_TLS_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]
      - ORDERER_ADMIN_TLS_CLIENTROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]
      - ORDERER_ADMIN_LISTENADDRESS=0.0.0.0:7053
    working_dir: /opt/gopath/src/github.com/hyperledger/fabric
    command: orderer
    volumes:
      - ../system-genesis-block/genesis.block:/var/hyperledger/orderer/orderer.genesis.block
      - ../organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp:/var/hyperledger/orderer/msp
      - ../organizations/ordererOrganizations/example.com/orderers/orderer.example.com/tls/:/var/hyperledger/orderer/tls
      - orderer.example.com:/var/hyperledger/production/orderer
    ports:
      - 7050:7050
      - 7053:7053
    networks:
      - test

  orderer2.example.com:
    container_name: orderer2.example.com
    image: hyperledger/fabric-orderer:latest
    labels:
      service: hyperledger-fabric
    environment:
      # - FABRIC_LOGGING_SPEC=INFO
      - FABRIC_LOGGING_SPEC=DEBUG
      - ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
      - ORDERER_GENERAL_LISTENPORT=8050
      - ORDERER_GENERAL_LOCALMSPID=OrdererMSP
      - ORDERER_GENERAL_LOCALMSPDIR=/var/hyperledger/orderer/msp
      # enabled TLS
      - ORDERER_GENERAL_TLS_ENABLED=true
      - ORDERER_GENERAL_TLS_PRIVATEKEY=/var/hyperledger/orderer/tls/server.key
      - ORDERER_GENERAL_TLS_CERTIFICATE=/var/hyperledger/orderer/tls/server.crt
      - ORDERER_GENERAL_TLS_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]
      - ORDERER_KAFKA_TOPIC_REPLICATIONFACTOR=1
      - ORDERER_KAFKA_VERBOSE=true
      - ORDERER_GENERAL_CLUSTER_CLIENTCERTIFICATE=/var/hyperledger/orderer/tls/server.crt
      - ORDERER_GENERAL_CLUSTER_CLIENTPRIVATEKEY=/var/hyperledger/orderer/tls/server.key
      - ORDERER_GENERAL_CLUSTER_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]
      - ORDERER_GENERAL_BOOTSTRAPMETHOD=none
      - ORDERER_CHANNELPARTICIPATION_ENABLED=true
      - ORDERER_ADMIN_TLS_ENABLED=true
      - ORDERER_ADMIN_TLS_CERTIFICATE=/var/hyperledger/orderer/tls/server.crt
      - ORDERER_ADMIN_TLS_PRIVATEKEY=/var/hyperledger/orderer/tls/server.key
      - ORDERER_ADMIN_TLS_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]
      - ORDERER_ADMIN_TLS_CLIENTROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]
      - ORDERER_ADMIN_LISTENADDRESS=0.0.0.0:7053
    working_dir: /opt/gopath/src/github.com/hyperledger/fabric
    command: orderer
    volumes:
      - ../system-genesis-block/genesis.block:/var/hyperledger/orderer/orderer.genesis.block
      - ../organizations/ordererOrganizations/example.com/orderers/orderer2.example.com/msp:/var/hyperledger/orderer/msp
      - ../organizations/ordererOrganizations/example.com/orderers/orderer2.example.com/tls/:/var/hyperledger/orderer/tls
      - orderer2.example.com:/var/hyperledger/production/orderer
    ports:
      - 8050:8050
      - 8053:7053
    networks:
      - test

  orderer3.example.com:
    container_name: orderer3.example.com
    image: hyperledger/fabric-orderer:latest
    labels:
      service: hyperledger-fabric
    environment:
      # - FABRIC_LOGGING_SPEC=INFO
      - FABRIC_LOGGING_SPEC=DEBUG
      - ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
      - ORDERER_GENERAL_LISTENPORT=9050
      - ORDERER_GENERAL_LOCALMSPID=OrdererMSP
      - ORDERER_GENERAL_LOCALMSPDIR=/var/hyperledger/orderer/msp
      # enabled TLS
      - ORDERER_GENERAL_TLS_ENABLED=true
      - ORDERER_GENERAL_TLS_PRIVATEKEY=/var/hyperledger/orderer/tls/server.key
      - ORDERER_GENERAL_TLS_CERTIFICATE=/var/hyperledger/orderer/tls/server.crt
      - ORDERER_GENERAL_TLS_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]
      - ORDERER_KAFKA_TOPIC_REPLICATIONFACTOR=1
      - ORDERER_KAFKA_VERBOSE=true
      - ORDERER_GENERAL_CLUSTER_CLIENTCERTIFICATE=/var/hyperledger/orderer/tls/server.crt
      - ORDERER_GENERAL_CLUSTER_CLIENTPRIVATEKEY=/var/hyperledger/orderer/tls/server.key
      - ORDERER_GENERAL_CLUSTER_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]
      - ORDERER_GENERAL_BOOTSTRAPMETHOD=none
      - ORDERER_CHANNELPARTICIPATION_ENABLED=true
      - ORDERER_ADMIN_TLS_ENABLED=true
      - ORDERER_ADMIN_TLS_CERTIFICATE=/var/hyperledger/orderer/tls/server.crt
      - ORDERER_ADMIN_TLS_PRIVATEKEY=/var/hyperledger/orderer/tls/server.key
      - ORDERER_ADMIN_TLS_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]
      - ORDERER_ADMIN_TLS_CLIENTROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]
      - ORDERER_ADMIN_LISTENADDRESS=0.0.0.0:7053
    working_dir: /opt/gopath/src/github.com/hyperledger/fabric
    command: orderer
    volumes:
      - ../system-genesis-block/genesis.block:/var/hyperledger/orderer/orderer.genesis.block
      - ../organizations/ordererOrganizations/example.com/orderers/orderer3.example.com/msp:/var/hyperledger/orderer/msp
      - ../organizations/ordererOrganizations/example.com/orderers/orderer3.example.com/tls/:/var/hyperledger/orderer/tls
      - orderer3.example.com:/var/hyperledger/production/orderer
    ports:
      - 9050:9050
      - 9053:7053
    networks:
      - test

orderer.example.com 的 docker 容器日志:

2021-07-26 21:36:40.751 UTC [orderer.consensus.etcdraft] Step -> INFO 7be 1 is starting a new election at term 1 channel=mychannel node=1
2021-07-26 21:36:40.751 UTC [orderer.consensus.etcdraft] becomePreCandidate -> INFO 7bf 1 became pre-candidate at term 1 channel=mychannel node=1
2021-07-26 21:36:40.751 UTC [orderer.consensus.etcdraft] poll -> INFO 7c0 1 received MsgPreVoteResp from 1 at term 1 channel=mychannel node=1
2021-07-26 21:36:40.751 UTC [orderer.consensus.etcdraft] campaign -> INFO 7c1 1 [logterm: 1,index: 3] sent MsgPreVote request to 2 at term 1 channel=mychannel node=1
2021-07-26 21:36:40.751 UTC [orderer.consensus.etcdraft] campaign -> INFO 7c2 1 [logterm: 1,index: 3] sent MsgPreVote request to 3 at term 1 channel=mychannel node=1
2021-07-26 21:36:40.751 UTC [orderer.common.cluster] NewStream -> DEBU 7c3 Created new stream to orderer2.example.com:8050 with ID of 26 and buffer size of 10
2021-07-26 21:36:40.751 UTC [orderer.consensus.etcdraft] consensusSent -> DEBU 7c4 Sending msg of 28 bytes to 2 on channel mychannel took 98.44µs
2021-07-26 21:36:40.751 UTC [orderer.consensus.etcdraft] send -> INFO 7c5 Successfully sent StepRequest to 2 after Failed attempt(s) channel=mychannel node=1
2021-07-26 21:36:40.751 UTC [orderer.common.cluster] NewStream -> DEBU 7c6 Created new stream to orderer3.example.com:9050 with ID of 26 and buffer size of 10
2021-07-26 21:36:40.751 UTC [orderer.consensus.etcdraft] consensusSent -> DEBU 7c7 Sending msg of 28 bytes to 3 on channel mychannel took 71.392µs
2021-07-26 21:36:40.751 UTC [orderer.consensus.etcdraft] send -> INFO 7c8 Successfully sent StepRequest to 3 after Failed attempt(s) channel=mychannel node=1
2021-07-26 21:36:40.751 UTC [orderer.common.cluster.step] sendMessage -> DEBU 7c9 Send of ConsensusRequest for channel mychannel with payload of size 28 to orderer3(orderer3.example.com:9050) took 44.832µs 
2021-07-26 21:36:40.751 UTC [orderer.common.cluster.step] sendMessage -> DEBU 7ca Send of ConsensusRequest for channel mychannel with payload of size 28 to orderer2(orderer2.example.com:8050) took 20.721µs 
2021-07-26 21:36:48.403 UTC [core.comm] ServerHandshake -> DEBU 7cb Server TLS handshake completed in 2.630606ms server=Orderer remoteaddress=
2021-07-26 21:36:48.403 UTC [orderer.common.server] Deliver -> DEBU 7cc Starting new Deliver handler
2021-07-26 21:36:48.403 UTC [common.deliver] Handle -> DEBU 7cd Starting new deliver loop for 
2021-07-26 21:36:48.404 UTC [common.deliver] Handle -> DEBU 7ce Attempting to read seek info message from 
2021-07-26 21:36:48.404 UTC [common.deliver] deliverBlocks -> WARN 7cf [channel: mychannel] Rejecting deliver request for  because of consenter error
2021-07-26 21:36:48.404 UTC [orderer.common.server] func1 -> DEBU 7d0 Closing Deliver stream
2021-07-26 21:36:48.404 UTC [comm.grpc.server] 1 -> INFO 7d1 streaming call completed grpc.service=orderer.Atomicbroadcast grpc.method=Deliver grpc.peer_address= grpc.code=OK grpc.call_duration=675.251µs
2021-07-26 21:36:48.405 UTC [grpc] InfoDepth -> DEBU 7d2 [transport]transport: loopyWriter.run returning. connection error: desc = "transport is closing"
2021-07-26 21:36:48.750 UTC [orderer.consensus.etcdraft] Step -> INFO 7d3 1 is starting a new election at term 1 channel=mychannel node=1
2021-07-26 21:36:48.750 UTC [orderer.consensus.etcdraft] becomePreCandidate -> INFO 7d4 1 became pre-candidate at term 1 channel=mychannel node=1
2021-07-26 21:36:48.750 UTC [orderer.consensus.etcdraft] poll -> INFO 7d5 1 received MsgPreVoteResp from 1 at term 1 channel=mychannel node=1
2021-07-26 21:36:48.750 UTC [orderer.consensus.etcdraft] campaign -> INFO 7d6 1 [logterm: 1,index: 3] sent MsgPreVote request to 2 at term 1 channel=mychannel node=1
2021-07-26 21:36:48.751 UTC [orderer.consensus.etcdraft] campaign -> INFO 7d7 1 [logterm: 1,index: 3] sent MsgPreVote request to 3 at term 1 channel=mychannel node=1
2021-07-26 21:36:48.751 UTC [orderer.consensus.etcdraft] consensusSent -> DEBU 7d8 Sending msg of 28 bytes to 2 on channel mychannel took 4.077µs
2021-07-26 21:36:48.751 UTC [orderer.consensus.etcdraft] consensusSent -> DEBU 7d9 Sending msg of 28 bytes to 3 on channel mychannel took 3.599µs
2021-07-26 21:36:48.751 UTC [orderer.common.cluster] 1 -> DEBU 7da Stream 26 to orderer3(orderer3.example.com:9050) is aborted
2021-07-26 21:36:48.751 UTC [orderer.common.cluster] 1 -> DEBU 7db Stream 26 to orderer2(orderer2.example.com:8050) is aborted
2021-07-26 21:36:48.751 UTC [orderer.common.cluster.step] sendMessage -> DEBU 7dc Send of ConsensusRequest for channel mychannel with payload of size 28 to orderer3(orderer3.example.com:9050) took 61.407µs but Failed due to EOF
2021-07-26 21:36:48.751 UTC [orderer.common.cluster.step] sendMessage -> DEBU 7dd Send of ConsensusRequest for channel mychannel with payload of size 28 to orderer2(orderer2.example.com:8050) took 66.918µs but Failed due to EOF
2021-07-26 21:36:48.751 UTC [orderer.common.cluster.step] serviceStream -> DEBU 7df Stream 26 to (orderer2.example.com:8050) terminated with total lifetime of 7.999445309s
2021-07-26 21:36:48.751 UTC [orderer.common.cluster.step] serviceStream -> DEBU 7de Stream 26 to (orderer3.example.com:9050) terminated with total lifetime of 7.999522414s
2021-07-26 21:36:56.751 UTC [orderer.consensus.etcdraft] Step -> INFO 7e0 1 is starting a new election at term 1 channel=mychannel node=1
2021-07-26 21:36:56.751 UTC [orderer.consensus.etcdraft] becomePreCandidate -> INFO 7e1 1 became pre-candidate at term 1 channel=mychannel node=1
2021-07-26 21:36:56.751 UTC [orderer.consensus.etcdraft] poll -> INFO 7e2 1 received MsgPreVoteResp from 1 at term 1 channel=mychannel node=1
2021-07-26 21:36:56.751 UTC [orderer.consensus.etcdraft] campaign -> INFO 7e3 1 [logterm: 1,index: 3] sent MsgPreVote request to 3 at term 1 channel=mychannel node=1
2021-07-26 21:36:56.751 UTC [orderer.consensus.etcdraft] campaign -> INFO 7e4 1 [logterm: 1,index: 3] sent MsgPreVote request to 2 at term 1 channel=mychannel node=1
2021-07-26 21:36:56.751 UTC [orderer.consensus.etcdraft] consensusSent -> DEBU 7e5 Sending msg of 28 bytes to 3 on channel mychannel took 25.709µs
2021-07-26 21:36:56.751 UTC [orderer.consensus.etcdraft] logSendFailure -> ERRO 7e6 Failed to send StepRequest to 3,because: EOF channel=mychannel node=1
2021-07-26 21:36:56.751 UTC [orderer.consensus.etcdraft] consensusSent -> DEBU 7e7 Sending msg of 28 bytes to 2 on channel mychannel took 5.017µs
2021-07-26 21:36:56.751 UTC [orderer.consensus.etcdraft] logSendFailure -> ERRO 7e8 Failed to send StepRequest to 2,because: EOF channel=mychannel node=1
2021-07-26 21:37:04.750 UTC [orderer.consensus.etcdraft] Step -> INFO 7e9 1 is starting a new election at term 1 channel=mychannel node=1
2021-07-26 21:37:04.750 UTC [orderer.consensus.etcdraft] becomePreCandidate -> INFO 7ea 1 became pre-candidate at term 1 channel=mychannel node=1
2021-07-26 21:37:04.751 UTC [orderer.consensus.etcdraft] poll -> INFO 7eb 1 received MsgPreVoteResp from 1 at term 1 channel=mychannel node=1
2021-07-26 21:37:04.751 UTC [orderer.consensus.etcdraft] campaign -> INFO 7ec 1 [logterm: 1,index: 3] sent MsgPreVote request to 2 at term 1 channel=mychannel node=1
2021-07-26 21:37:04.751 UTC [orderer.consensus.etcdraft] campaign -> INFO 7ed 1 [logterm: 1,index: 3] sent MsgPreVote request to 3 at term 1 channel=mychannel node=1
2021-07-26 21:37:04.751 UTC [orderer.common.cluster] NewStream -> DEBU 7ee Created new stream to orderer2.example.com:8050 with ID of 27 and buffer size of 10
2021-07-26 21:37:04.751 UTC [orderer.consensus.etcdraft] consensusSent -> DEBU 7ef Sending msg of 28 bytes to 2 on channel mychannel took 271.523µs
2021-07-26 21:37:04.751 UTC [orderer.consensus.etcdraft] send -> INFO 7f0 Successfully sent StepRequest to 2 after Failed attempt(s) channel=mychannel node=1
2021-07-26 21:37:04.751 UTC [orderer.common.cluster.step] sendMessage -> DEBU 7f1 Send of ConsensusRequest for channel mychannel with payload of size 28 to orderer2(orderer2.example.com:8050) took 130.526µs 
2021-07-26 21:37:04.752 UTC [orderer.common.cluster] NewStream -> DEBU 7f2 Created new stream to orderer3.example.com:9050 with ID of 27 and buffer size of 10
2021-07-26 21:37:04.752 UTC [orderer.consensus.etcdraft] consensusSent -> DEBU 7f3 Sending msg of 28 bytes to 3 on channel mychannel took 627.237µs
2021-07-26 21:37:04.752 UTC [orderer.consensus.etcdraft] send -> INFO 7f4 Successfully sent StepRequest to 3 after Failed attempt(s) channel=mychannel node=1
2021-07-26 21:37:04.752 UTC [orderer.common.cluster.step] sendMessage -> DEBU 7f5 Send of ConsensusRequest for channel mychannel with payload of size 28 to orderer3(orderer3.example.com:9050) took 98.032µs 
2021-07-26 21:37:12.751 UTC [orderer.consensus.etcdraft] Step -> INFO 7f6 1 is starting a new election at term 1 channel=mychannel node=1
2021-07-26 21:37:12.751 UTC [orderer.consensus.etcdraft] becomePreCandidate -> INFO 7f7 1 became pre-candidate at term 1 channel=mychannel node=1
2021-07-26 21:37:12.751 UTC [orderer.consensus.etcdraft] poll -> INFO 7f8 1 received MsgPreVoteResp from 1 at term 1 channel=mychannel node=1
2021-07-26 21:37:12.751 UTC [orderer.consensus.etcdraft] campaign -> INFO 7f9 1 [logterm: 1,index: 3] sent MsgPreVote request to 2 at term 1 channel=mychannel node=1
2021-07-26 21:37:12.751 UTC [orderer.consensus.etcdraft] campaign -> INFO 7fa 1 [logterm: 1,index: 3] sent MsgPreVote request to 3 at term 1 channel=mychannel node=1
2021-07-26 21:37:12.751 UTC [orderer.consensus.etcdraft] consensusSent -> DEBU 7fb Sending msg of 28 bytes to 2 on channel mychannel took 4.668µs
2021-07-26 21:37:12.751 UTC [orderer.consensus.etcdraft] consensusSent -> DEBU 7fc Sending msg of 28 bytes to 3 on channel mychannel took 2.001µs
2021-07-26 21:37:12.751 UTC [orderer.common.cluster] 1 -> DEBU 7fd Stream 27 to orderer3(orderer3.example.com:9050) is aborted
2021-07-26 21:37:12.751 UTC [orderer.common.cluster.step] sendMessage -> DEBU 7fe Send of ConsensusRequest for channel mychannel with payload of size 28 to orderer3(orderer3.example.com:9050) took 102.584µs but Failed due to EOF
2021-07-26 21:37:12.751 UTC [orderer.common.cluster.step] serviceStream -> DEBU 7ff Stream 27 to (orderer3.example.com:9050) terminated with total lifetime of 7.999196657s
2021-07-26 21:37:12.751 UTC [orderer.common.cluster] 1 -> DEBU 800 Stream 27 to orderer2(orderer2.example.com:8050) is aborted
2021-07-26 21:37:12.751 UTC [orderer.common.cluster.step] sendMessage -> DEBU 801 Send of ConsensusRequest for channel mychannel with payload of size 28 to orderer2(orderer2.example.com:8050) took 24.421µs but Failed due to EOF
2021-07-26 21:37:12.751 UTC [orderer.common.cluster.step] serviceStream -> DEBU 802 Stream 27 to (orderer2.example.com:8050) terminated with total lifetime of 7.999721572s

终端上的实际错误

Setting anchor peer for org1...
Using organization 1
Fetching channel config for channel mychannel
Using organization 1
Fetching the most recent configuration block for the channel
+ peer channel fetch config config_block.pb -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 -c mychannel
2021-07-26 21:26:40.010 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2021-07-26 21:26:40.012 UTC [cli.common] readBlock -> INFO 002 Expect block,but got status: &{SERVICE_UNAVAILABLE}
Error: can't read the block: &{SERVICE_UNAVAILABLE}
Decoding config block to JSON and isolating config to Org1MSPconfig.json
+ configtxlator proto_decode --input config_block.pb --type common.Block
+ jq '.data.data[0].payload.data.config'
configtxlator: error: open config_block.pb: no such file or directory,try --help
+ jq '.channel_group.groups.Application.groups.Org1MSP.values += {"AnchorPeers":{"mod_policy": "Admins","value":{"anchor_peers": [{"host": "peer0.org1.example.com","port": 7051}]},"version": "0"}}' Org1MSPconfig.json
Generating anchor peer update transaction for Org1 on channel mychannel
+ configtxlator proto_encode --input Org1MSPconfig.json --type common.Config
configtxlator: error: Error decoding: error decoding input: error unmarshaling intermediate JSON: EOF
+ configtxlator proto_encode --input Org1MSPmodified_config.json --type common.Config
configtxlator: error: Error decoding: error decoding input: error unmarshaling intermediate JSON: EOF
+ configtxlator compute_update --channel_id mychannel --original original_config.pb --updated modified_config.pb
configtxlator: error: Error computing update: error computing config update: no channel group included for original config
+ configtxlator proto_decode --input config_update.pb --type common.ConfigUpdate
+ jq .
++ cat config_update.json
+ echo '{"payload":{"header":{"channel_header":{"channel_id":"mychannel","type":2}},"data":{"config_update":{' '"channel_id":' '"",' '"isolated_data":' '{},' '"read_set":' null,'"write_set":' null '}}}}'
+ configtxlator proto_encode --input config_update_in_envelope.json --type common.Envelope
2021-07-26 21:26:40.664 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: ConfigUpdate for channel '' but envelope for channel 'mychannel'
Anchor peer update Failed

我对这个问题的猜测之一是订购者无法相互交谈,因为一旦我从同意者(configtx.yaml)中删除额外的 2 个订购者,一切似乎都可以正常工作 如果有人可以为我提供任何解决方案,那将是一个很大的帮助。

解决方法

如果您认为添加的排序器不起作用, 您可以在这里查看订购者的筏状态

http://[您的订购者 IP]:8443/metrics

orderer.yaml 中定义的 8443 端口

Operations:
      ListenAddress: [] < -- here

和Ctrl + F,搜索“consensus_etcdraft_is_leader”