@@ -47,26 +47,24 @@ in its own organization.
47
47
Leader election
48
48
---------------
49
49
50
- The leader election mechanism is used to **elect ** one peer per each organization
51
- which will maintain connection with ordering service and initiate distribution of
52
- newly arrived blocks across peers of its own organization. Leveraging leader election
53
- provides system with ability to efficiently utilize bandwidth of the ordering
54
- service. There are two possible operation modes for leader election module:
55
-
56
- 1. **Static ** -- system administrator manually configures one peer in the organization
57
- to be the leader, e.g. one to maintain open connection with the ordering service.
58
- 2. **Dynamic ** -- peers execute a leader election procedure to select one peer in an
59
- organization to become leader, pull blocks from the ordering service, and disseminate
60
- blocks to the other peers in the organization.
50
+ The leader election mechanism is used to **elect ** one peer per organization
51
+ which will maintain connection with the ordering service and initiate distribution of
52
+ newly arrived blocks across the peers of its own organization. Leveraging leader election
53
+ provides the system with the ability to efficiently utilize the bandwidth of the ordering
54
+ service. There are two possible modes of operation for a leader election module:
55
+
56
+ 1. **Static ** --- a system administrator manually configures a peer in an organization to
57
+ be the leader.
58
+ 2. **Dynamic ** --- peers execute a leader election procedure to select one peer in an
59
+ organization to become leader.
61
60
62
61
Static leader election
63
62
~~~~~~~~~~~~~~~~~~~~~~
64
63
65
- Using static leader election allows to manually define a set of leader peers within the organization, it's
66
- possible to define a single node to be a leader or all available peers, it should be taken into account that -
67
- making too many peers to connect to the ordering service might lead to inefficient bandwidth
68
- utilization. To enable static leader election mode, configure the following parameters
69
- within the section of ``core.yaml ``:
64
+ Static leader election allows you to manually define one or more peers within an
65
+ organization as leader peers. Please note, however, that having too many peers connect
66
+ to the ordering service may result in inefficient use of bandwidth. To enable static
67
+ leader election mode, configure the following parameters within the section of ``core.yaml ``:
70
68
71
69
::
72
70
@@ -97,23 +95,23 @@ Alternatively these parameters could be configured and overridden with environme
97
95
3. In static configuration organization admin is responsible to provide high availability
98
96
of the leader node in case for failure or crashes.
99
97
100
-
101
98
Dynamic leader election
102
99
~~~~~~~~~~~~~~~~~~~~~~~
103
100
104
101
Dynamic leader election enables organization peers to **elect ** one peer which will
105
- connect to the ordering service and pull out new blocks. Leader is elected for set
106
- of peers for each organization independently.
107
-
108
- Elected leader is responsible to send the **heartbeat ** messages to the rest of the peers
109
- as an evidence of liveness. If one or more peers won't get **heartbeats ** updates during
110
- period of time, they will initiate a new round of leader election procedure, eventually
111
- selecting a new leader. In case of a network partition in the worst case
112
- there will be more than one active leader for organization thus to guarantee resiliency
113
- and availability allowing the organization's peers to continue making progress. After
114
- the network partition is healed one of the leaders will relinquish its leadership, therefore in
115
- steady state and in no presence of network partitions for each organization there will be **only **
116
- one active leader connecting to the ordering service.
102
+ connect to the ordering service and pull out new blocks. This leader is elected
103
+ for an organization's peers independently.
104
+
105
+ A dynamically elected leader sends **heartbeat ** messages to the rest of the peers
106
+ as an evidence of liveness. If one or more peers don't receive **heartbeats ** updates
107
+ during a set period of time, they will elect a new leader.
108
+
109
+ In the worst case scenario of a network partition, there will be more than one
110
+ active leader for organization to guarantee resiliency and availability to allow
111
+ an organization's peers to continue making progress. After the network partition
112
+ has been healed, one of the leaders will relinquish its leadership. In
113
+ a steady state with no network partitions, there will be
114
+ **only ** one active leader connecting to the ordering service.
117
115
118
116
Following configuration controls frequency of the leader **heartbeat ** messages:
119
117
@@ -136,7 +134,7 @@ within ``core.yaml``:
136
134
useLeaderElection: true
137
135
orgLeader: false
138
136
139
- Alternatively these parameters could be configured and overridden with environmental variables:
137
+ Alternatively these parameters could be configured and overridden with environment variables:
140
138
141
139
::
142
140
@@ -171,6 +169,39 @@ recommended that every organization provides its own set of anchor peers for hig
171
169
availability and redundancy. Note that the anchor peer does not need to be the
172
170
same peer as the leader peer.
173
171
172
+ External and internal endpoints
173
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
174
+
175
+ In order for gossip to work effectively, peers need to be able to obtain the
176
+ endpoint information of peers in their own organization as well as from peers in
177
+ other organizations.
178
+
179
+ The ``CORE_PEER_GOSSIP_BOOTSTRAP `` property in the ``core.yaml `` of the peer is
180
+ used to bootstrap gossip within an organization. If you are using gossip, you
181
+ will typically configure all the peers in your organization to point to an initial set of
182
+ bootstrap peers (you can specific a space-separated list of peers). Peers
183
+ can bootstrap from different peers as well, but in that case you need to make
184
+ sure that there is a bootstrap path across all peers. Peers within an organization
185
+ will typically communicate on their internal endpoints (meaning you do not have
186
+ to expose all the peers in an organization publicly). When the peer contacts the bootstrap
187
+ peer, it passes its endpoint info and then gossip is used to distribute the
188
+ information about all the peers in the organization among the peers in that
189
+ organization.
190
+
191
+ Bootstrap information is similarly required to establish communication across
192
+ organizations. The initial cross-organization bootstrap information is provided
193
+ via the "anchor peers" setting described above. If you want to make other peers
194
+ in your organization known to other organizations, you need to set the
195
+ ``CORE_PEER_GOSSIP_EXTERNALENDPOINT `` property in the ``core.yaml `` of your peer.
196
+ If this is not set, the endpoint information of the peer will not be broadcast
197
+ to peers in other organizations.
198
+
199
+ To set these properties, issue:
200
+
201
+ ::
202
+
203
+ export CORE_PEER_GOSSIP_BOOTSTRAP=<the_peer_endpoint>
204
+ export CORE_PEER_GOSSIP_EXTERNALENDPOINT=<the_peer_endpoint>
174
205
175
206
Gossip messaging
176
207
----------------
@@ -196,7 +227,7 @@ Because channels are segregated, peers on one channel cannot message or
196
227
share information on any other channel. Though any peer can belong
197
228
to multiple channels, partitioned messaging prevents blocks from being disseminated
198
229
to peers that are not in the channel by applying message routing policies based
199
- on peers' channel subscriptions.
230
+ on a peers' channel subscriptions.
200
231
201
232
.. note :: 1. Security of point-to-point messages are handled by the peer TLS layer, and do
202
233
not require signatures. Peers are authenticated by their certificates,
0 commit comments