Prechádzať zdrojové kódy

Increase raft ElectionTick to 10xHeartbeatTick

Signed-off-by: Anshul Pundir <anshul.pundir@docker.com>
Anshul Pundir 7 rokov pred
rodič
commit
6abee2008b
1 zmenil súbory, kde vykonal 5 pridanie a 2 odobranie
  1. 5 2
      daemon/cluster/noderunner.go

+ 5 - 2
daemon/cluster/noderunner.go

@@ -124,8 +124,11 @@ func (n *nodeRunner) start(conf nodeStartConfig) error {
 			n.cluster.config.Backend,
 			n.cluster.config.PluginBackend,
 			n.cluster.config.ImageBackend),
-		HeartbeatTick:    1,
-		ElectionTick:     3,
+		HeartbeatTick: 1,
+		// Recommended value in etcd/raft is 10 x (HeartbeatTick).
+		// Lower values were seen to have caused instability because of
+		// frequent leader elections when running on flakey networks.
+		ElectionTick:     10,
 		UnlockKey:        conf.lockKey,
 		AutoLockManagers: conf.autolock,
 		PluginGetter:     n.cluster.config.Backend.PluginGetter(),