SERVICE UNAVAILABLE - No raft leader when trying to create channel in Hyperledger fabric setup in Kubernetes

4/13/2020

Start_orderer.sh file:

#edit *values.yaml file to be used with helm chart and deploy orderer through it

consensus_type=etcdraft
#change below instantiated variable for changing configuration of persistent volume sizes  
persistence_status=true
persistent_volume_size=2Gi

while getopts "i:o:O:d:" c
do
    case $c in
        i) network_id=$OPTARG ;;
        o) number=$OPTARG ;;
        O) org_name=$OPTARG ;;
        d) domain=$OPTARG ;;
    esac
done

network_path=/etc/zeeve/fabric/${network_id}
source status.sh

cp ../yaml-files/orderer.yaml $network_path/yaml-files/orderer-${number}${org_name}_values.yaml
sed -i "s/persistence_status/$persistence_status/; s/persistent_volume_size/$persistent_volume_size/; s/consensus_type/$consensus_type/; s/number/$number/g; s/org_name/${org_name}/; s/domain/$domain/; " $network_path/yaml-files/orderer-${number}${org_name}_values.yaml

helm install orderer-${number}${org_name} --namespace blockchain-${org_name} -f $network_path/yaml-files/orderer-${number}${org_name}_values.yaml `pwd`/../helm-charts/hlf-ord
cmd_success $? orderer-${number}${org_name}

#update state of deployed componenet, used for pod level operations like start, stop, restart etc
update_statusfile helm orderer_${number}${org_name} orderer-${number}${org_name}
update_statusfile persistence orderer_${number}${org_name} $persistence_status

Configtx.yaml:

# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0

Organizations:

    - &Orginvestor
        Name: investor
        ID: investorMSP
        MSPDir: ./crypto-config/investor/msp
        AnchorPeers:
            - Host: peer1.investor.demointainabs.emulya.com
              Port: 443

    - &Orgtrustee
        Name: trustee
        ID: trusteeMSP
        MSPDir: ./crypto-config/trustee/msp
        AnchorPeers:
            - Host: peer1.trustee.demointainabs.emulya.com
              Port: 443

    - &Orgwhlender
        Name: whlender
        ID: whlenderMSP
        MSPDir: ./crypto-config/whlender/msp
        AnchorPeers:
            - Host: peer1.whlender.demointainabs.emulya.com
              Port: 443

    - &Orgservicer
        Name: servicer
        ID: servicerMSP
        MSPDir: ./crypto-config/servicer/msp
        AnchorPeers:
            - Host: peer1.servicer.demointainabs.emulya.com
              Port: 443

    - &Orgissuer
        Name: issuer
        ID: issuerMSP
        MSPDir: ./crypto-config/issuer/msp
        AnchorPeers:
            - Host: peer1.issuer.demointainabs.emulya.com
              Port: 443

    - &Orgoriginator
        Name: originator
        ID: originatorMSP
        MSPDir: ./crypto-config/originator/msp
        AnchorPeers:
            - Host: peer1.originator.demointainabs.emulya.com
              Port: 443

    - &Orginvestor
        Name: investor
        ID: investorMSP
        MSPDir: ./crypto-config/investor/msp
        AnchorPeers:
            - Host: peer1.investor.intainabs.emulya.com
              Port: 443

    - &Orgtrustee
        Name: trustee
        ID: trusteeMSP
        MSPDir: ./crypto-config/trustee/msp
        AnchorPeers:
            - Host: peer1.trustee.intainabs.emulya.com
              Port: 443

    - &Orgwhlender
        Name: whlender
        ID: whlenderMSP
        MSPDir: ./crypto-config/whlender/msp
        AnchorPeers:
            - Host: peer1.whlender.intainabs.emulya.com
              Port: 443

    - &Orgservicer
        Name: servicer
        ID: servicerMSP
        MSPDir: ./crypto-config/servicer/msp
        AnchorPeers:
            - Host: peer1.servicer.intainabs.emulya.com
              Port: 443

    - &Orgissuer
        Name: issuer
        ID: issuerMSP
        MSPDir: ./crypto-config/issuer/msp
        AnchorPeers:
            - Host: peer1.issuer.intainabs.emulya.com
              Port: 443

    - &Orgoriginator
        Name: originator
        ID: originatorMSP
        MSPDir: ./crypto-config/originator/msp
        AnchorPeers:
            - Host: peer1.originator.intainabs.emulya.com
              Port: 443

Orderer: &OrdererDefaults

    OrdererType: etcdraft

    Addresses:
        - orderer1.originator.demointainabs.emulya.com:443
        - orderer2.trustee.demointainabs.emulya.com:443
        - orderer2.issuer.demointainabs.emulya.com:443
        - orderer1.trustee.demointainabs.emulya.com:443
        - orderer1.issuer.demointainabs.emulya.com:443
        - orderer1.originator.intainabs.emulya.com:443
        - orderer2.trustee.intainabs.emulya.com:443
        - orderer2.issuer.intainabs.emulya.com:443
        - orderer1.trustee.intainabs.emulya.com:443
        - orderer1.issuer.intainabs.emulya.com:443
    BatchTimeout: 2s
    BatchSize:
        MaxMessageCount: 10
        AbsoluteMaxBytes: 99 MB
        PreferredMaxBytes: 512 KB
    Kafka:
        Brokers:
            - kafka-hlf.blockchain-kz.svc.cluster.local:9092
    EtcdRaft:
        Consenters:
        - Host: orderer1.originator.demointainabs.emulya.com
          Port: 443
          ClientTLSCert: crypto-config/originator/orderer-1originator/tls/server.crt
          ServerTLSCert: crypto-config/originator/orderer-1originator/tls/server.crt
        - Host: orderer2.trustee.demointainabs.emulya.com
          Port: 443
          ClientTLSCert: crypto-config/trustee/orderer-2trustee/tls/server.crt
          ServerTLSCert: crypto-config/trustee/orderer-2trustee/tls/server.crt
        - Host: orderer2.issuer.demointainabs.emulya.com
          Port: 443
          ClientTLSCert: crypto-config/issuer/orderer-2issuer/tls/server.crt
          ServerTLSCert: crypto-config/issuer/orderer-2issuer/tls/server.crt
        - Host: orderer1.trustee.demointainabs.emulya.com
          Port: 443
          ClientTLSCert: crypto-config/trustee/orderer-1trustee/tls/server.crt
          ServerTLSCert: crypto-config/trustee/orderer-1trustee/tls/server.crt
        - Host: orderer1.issuer.demointainabs.emulya.com
          Port: 443
          ClientTLSCert: crypto-config/issuer/orderer-1issuer/tls/server.crt
          ServerTLSCert: crypto-config/issuer/orderer-1issuer/tls/server.crt
        - Host: orderer1.originator.intainabs.emulya.com
          Port: 443
          ClientTLSCert: crypto-config/originator/orderer-1originator/tls/server.crt
          ServerTLSCert: crypto-config/originator/orderer-1originator/tls/server.crt
        - Host: orderer2.trustee.intainabs.emulya.com
          Port: 443
          ClientTLSCert: crypto-config/trustee/orderer-2trustee/tls/server.crt
          ServerTLSCert: crypto-config/trustee/orderer-2trustee/tls/server.crt
        - Host: orderer2.issuer.intainabs.emulya.com
          Port: 443
          ClientTLSCert: crypto-config/issuer/orderer-2issuer/tls/server.crt
          ServerTLSCert: crypto-config/issuer/orderer-2issuer/tls/server.crt
        - Host: orderer1.trustee.intainabs.emulya.com
          Port: 443
          ClientTLSCert: crypto-config/trustee/orderer-1trustee/tls/server.crt
          ServerTLSCert: crypto-config/trustee/orderer-1trustee/tls/server.crt
        - Host: orderer1.issuer.intainabs.emulya.com
          Port: 443
          ClientTLSCert: crypto-config/issuer/orderer-1issuer/tls/server.crt
          ServerTLSCert: crypto-config/issuer/orderer-1issuer/tls/server.crt

    Organizations:

Application: &ApplicationDefaults
    Organizations:

Profiles:

    BaseGenesis:
        Orderer:
            <<: *OrdererDefaults
            Organizations:
                - *Orgoriginator
                - *Orgtrustee
                - *Orgissuer
                - *Orgoriginator
                - *Orgtrustee
                - *Orgissuer
        Consortiums:
            MyConsortium:
                Organizations:
                    - *Orginvestor
                    - *Orgtrustee
                    - *Orgwhlender
                    - *Orgservicer
                    - *Orgissuer
                    - *Orgoriginator
                    - *Orginvestor
                    - *Orgtrustee
                    - *Orgwhlender
                    - *Orgservicer
                    - *Orgissuer
                    - *Orgoriginator

    BaseChannel:
        Consortium: MyConsortium
        Application:
            <<: *ApplicationDefaults
            Organizations:
                - *Orgoriginator
                - *Orgissuer
                - *Orgservicer
                - *Orgwhlender
                - *Orgtrustee
                - *Orginvestor
                - *Orgoriginator
                - *Orgissuer
                - *Orgservicer
                - *Orgwhlender
                - *Orgtrustee
                - *Orginvestor

I am currently doing hyperledger fabric network setup in Kubernetes. My network includes, 6 organizations and 5 orderer nodes. Our orderers are made to follow raft consensus. I have done the following:

  • Setup ca and tlsca servers
  • Setup ingress controller
  • Generated crypto-materials for peers, orderer
  • Generated channel artifacts -- Started peers and orderers

Next step is to create the channel on orderer for each orgs and join the peers in each org to the channel. I am unable to create the channel. When requesting to create the channel, getting the following error:

SERVICE UNAVAILABLE - No raft leader.

How to fix this issue??

Can anyone please guide me on this. Thanks in advance.

-- Soundarya
hyperledger
hyperledger-fabric
kubernetes

0 Answers