0

I have 3 orderer nodes and 5 peer nodes in my fabric network.

And I have tried to use raft consensus in my fabric network, but I got such error in the orderer logs:

2021-04-03 07:13:03.556 UTC [orderer.consensus.etcdraft] logSendFailure -> DEBU 1dc6 Failed to send StepRequest to 3, because: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial tcp 172.20.0.17:7548: connect: connection refused" channel=orderer-system-channel node=1

here are the key settings of one of the three orderer nodes in docker-compose.yaml:

      - FABRIC_LOGGING_SPEC=debug
      - ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
      - ORDERER_GENERAL_BOOTSTRAPMETHOD=file
      - ORDERER_GENERAL_BOOTSTRAPFILE=/etc/hyperledger/fabric/genesis.block
      - ORDERER_GENERAL_LOCALMSPID=OrdererMSP
      - ORDERER_GENERAL_LOCALMSPDIR=/etc/hyperledger/msp/orderer
      - ORDERER_GENERAL_TLS_ENABLED=true
      - ORDERER_GENERAL_TLS_PRIVATEKEY=/etc/hyperledger/tls/orderer/server.key
      - ORDERER_GENERAL_TLS_CERTIFICATE=/etc/hyperledger/tls/orderer/server.crt
      - ORDERER_GENERAL_TLS_ROOTCAS=[/etc/hyperledger/tls/orderer/ca.crt]
      - ORDERER_GENERAL_CLUSTER_LISTENADDRESS=0.0.0.0
      - ORDERER_GENERAL_CLUSTER_LISTENPORT=7055
      - ORDERER_GENERAL_CLUSTER_SERVERCERTIFICATE=/etc/hyperledger/tls/orderer/server.crt
      - ORDERER_GENERAL_CLUSTER_SERVERPRIVATEKEY=/etc/hyperledger/tls/orderer/server.key
      - ORDERER_GENERAL_CLUSTER_CLIENTCERTIFICATE=/etc/hyperledger/tls/orderer/server.crt
      - ORDERER_GENERAL_CLUSTER_CLIENTPRIVATEKEY=/etc/hyperledger/tls/orderer/server.key
      - ORDERER_GENERAL_CLUSTER_ROOTCAS=[/etc/hyperledger/tls/orderer/ca.crt]
      - ORDERER_GENERAL_TLS_CLIENTAUTHREQUIRED
      - ORDERER_GENERAL_TLS_CLIENTROOTCAS
    working_dir: /opt/gopath/src/github.com/hyperledger/fabric
    command: orderer
    volumes:
      - ../fabric/genesis.block:/etc/hyperledger/fabric/genesis.block
      - ../fabric/organizations/ordererOrganizations/food.com/orderers/orderer1.food.com/msp:/etc/hyperledger/msp/orderer
      - ../fabric/organizations/ordererOrganizations/food.com/orderers/orderer1.food.com/tls/:/etc/hyperledger/tls/orderer
      - orderer1.food.com:/var/hyperledger/production/orderer
    ports:
      - 7050:7050
      - 7550:7055

and this are the key settings in configtx.yaml about "Orderer":

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:
    - orderer1.food.com:7050
    - orderer2.food.com:7049
    - orderer3.food.com:7048

  EtcdRaft:
    Consenters:
      - Host: orderer1.food.com
        Port: 7550
        ClientTLSCert: ../fabric/organizations/ordererOrganizations/food.com/orderers/orderer1.food.com/tls/server.crt
        ServerTLSCert: ../fabric/organizations/ordererOrganizations/food.com/orderers/orderer1.food.com/tls/server.crt
      - Host: orderer2.food.com
        Port: 7549
        ClientTLSCert: ../fabric/organizations/ordererOrganizations/food.com/orderers/orderer2.food.com/tls/server.crt
        ServerTLSCert: ../fabric/organizations/ordererOrganizations/food.com/orderers/orderer2.food.com/tls/server.crt
      - Host: orderer3.food.com
        Port: 7548
        ClientTLSCert: ../fabric/organizations/ordererOrganizations/food.com/orderers/orderer3.food.com/tls/server.crt
        ServerTLSCert: ../fabric/organizations/ordererOrganizations/food.com/orderers/orderer3.food.com/tls/server.crt

  BatchTimeout: 2s

  BatchSize:

    MaxMessageCount: 10

    AbsoluteMaxBytes: 99 MB

    PreferredMaxBytes: 512 KB

  Organizations:

  Policies:
    Readers:
      Type: ImplicitMeta
      Rule: "ANY Readers"
    Writers:
      Type: ImplicitMeta
      Rule: "ANY Writers"
    Admins:
      Type: ImplicitMeta
      Rule: "MAJORITY Admins"
    BlockValidation:
      Type: ImplicitMeta
      Rule: "ANY Writers"

and here are my crypto-config.yaml used to generate crypto config for orderer nodes:

OrdererOrgs:
  # ---------------------------------------------------------------------------
  # Orderer
  # ---------------------------------------------------------------------------
  - Name: Orderer
    Domain: food.com
    EnableNodeOUs: true
    Specs:
      - Hostname: orderer1
        SANS:
          - localhost
      - Hostname: orderer2
        SANS:
          - localhost
      - Hostname: orderer3
        SANS:
          - localhost

Does anyone know how to solve this problem?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Mikasa JD
  • 83
  • 4
  • may be the port is not correct,in test-network ports seems like these http://lifegoeson.cn:8888/image/g4U5 – Li Xian Apr 03 '21 at 08:34
  • the port are all "7050". Will the ports not conflict? Can I learn more details? Such as the docker-compose settings? @李可以 – Mikasa JD Apr 03 '21 at 10:10
  • I know where I was wrong. The communication of raft cluster were in the docker network. So I should set the ports "7055" where I have set in docker-compose. Thanks for reminding. @李可以 – Mikasa JD Apr 03 '21 at 10:55

0 Answers0