Friday, June 5, 2020

Static Leader Election in Hyperledger Fabric Peer


How to enable static leader election in HLF?

Static leader election allows you to manually define one or more peers within an organization as leader peers. Please note, however, that having too many peers connect to the ordering service may result in inefficient use of bandwidth. To enable static leader election mode, configure the following parameters within the section of core.yaml:  


 vi /fabric-samples/config/core.yaml


peer:
    # Gossip related configuration
    gossip:
        useLeaderElectionfalse
        orgLeadertrue

Alternatively, these parameters could be configured and overridden with environmental variables:

export CORE_PEER_GOSSIP_USELEADERELECTION=false
export CORE_PEER_GOSSIP_ORGLEADER=true

Note:
The following configuration will keep peer in stand-by mode, i.e. peer will not try to become a leader:

export CORE_PEER_GOSSIP_USELEADERELECTION=false
export CORE_PEER_GOSSIP_ORGLEADER=false


  • Setting CORE_PEER_GOSSIP_USELEADERELECTION and CORE_PEER_GOSSIP_ORGLEADER with true value is ambiguous and will lead to an error.
  • In static configuration organization admin is responsible to provide high availability of the leader node in case for failure or crashes.

No comments:

Post a Comment

My MBA Story: The importance of lifelong learning and how it supports career growth in the tech industry

It's been over 8 years since I started working as a software engineer. Throughout my career, one thing that's become clear is how ra...