chore(cluster_config): set default timeout to 5s
Or the leader death could let the standbys down for a rather long time.
This commit is contained in:
@ -18,11 +18,11 @@ If there are not enough peers to meet the active size then, standbys will send j
|
|||||||
If there are more peers than the target active size then peers are removed by the leader and will become standbys.
|
If there are more peers than the target active size then peers are removed by the leader and will become standbys.
|
||||||
|
|
||||||
The remove delay specifies how long the cluster should wait before removing a dead peer.
|
The remove delay specifies how long the cluster should wait before removing a dead peer.
|
||||||
By default this is 30 minutes.
|
By default this is 5 seconds.
|
||||||
If a peer is inactive for 30 minutes then the peer is removed.
|
If a peer is inactive for 5 seconds then the peer is removed.
|
||||||
|
|
||||||
The standby sync interval specifies the synchronization interval of standbys with the cluster.
|
The standby sync interval specifies the synchronization interval of standbys with the cluster.
|
||||||
By default this is 30 minutes.
|
By default this is 5 seconds.
|
||||||
After each interval, standbys synchronize information with cluster.
|
After each interval, standbys synchronize information with cluster.
|
||||||
|
|
||||||
|
|
||||||
|
@ -12,13 +12,13 @@ const (
|
|||||||
MinActiveSize = 3
|
MinActiveSize = 3
|
||||||
|
|
||||||
// DefaultRemoveDelay is the default elapsed time before removal.
|
// DefaultRemoveDelay is the default elapsed time before removal.
|
||||||
DefaultRemoveDelay = float64((30 * time.Minute) / time.Second)
|
DefaultRemoveDelay = float64((5 * time.Second) / time.Second)
|
||||||
|
|
||||||
// MinRemoveDelay is the minimum remove delay allowed.
|
// MinRemoveDelay is the minimum remove delay allowed.
|
||||||
MinRemoveDelay = float64((2 * time.Second) / time.Second)
|
MinRemoveDelay = float64((2 * time.Second) / time.Second)
|
||||||
|
|
||||||
// DefaultSyncInterval is the default interval for cluster sync.
|
// DefaultSyncInterval is the default interval for cluster sync.
|
||||||
DefaultSyncInterval = float64((30 * time.Minute) / time.Second)
|
DefaultSyncInterval = float64((5 * time.Second) / time.Second)
|
||||||
|
|
||||||
// MinSyncInterval is the minimum sync interval allowed.
|
// MinSyncInterval is the minimum sync interval allowed.
|
||||||
MinSyncInterval = float64((1 * time.Second) / time.Second)
|
MinSyncInterval = float64((1 * time.Second) / time.Second)
|
||||||
|
@ -104,13 +104,13 @@ func CreateCluster(size int, procAttr *os.ProcAttr, ssl bool) ([][]string, []*os
|
|||||||
|
|
||||||
for i := 0; i < size; i++ {
|
for i := 0; i < size; i++ {
|
||||||
if i == 0 {
|
if i == 0 {
|
||||||
argGroup[i] = []string{"etcd", "-data-dir=/tmp/node1", "-name=node1"}
|
argGroup[i] = []string{"etcd", "-data-dir=/tmp/node1", "-name=node1", "-cluster-remove-delay=1800"}
|
||||||
if ssl {
|
if ssl {
|
||||||
argGroup[i] = append(argGroup[i], sslServer1...)
|
argGroup[i] = append(argGroup[i], sslServer1...)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
strI := strconv.Itoa(i + 1)
|
strI := strconv.Itoa(i + 1)
|
||||||
argGroup[i] = []string{"etcd", "-name=node" + strI, fmt.Sprintf("-addr=127.0.0.1:%d", 4001+i), fmt.Sprintf("-peer-addr=127.0.0.1:%d", 7001+i), "-data-dir=/tmp/node" + strI, "-peers=127.0.0.1:7001"}
|
argGroup[i] = []string{"etcd", "-name=node" + strI, fmt.Sprintf("-addr=127.0.0.1:%d", 4001+i), fmt.Sprintf("-peer-addr=127.0.0.1:%d", 7001+i), "-data-dir=/tmp/node" + strI, "-peers=127.0.0.1:7001", "-cluster-remove-delay=1800"}
|
||||||
if ssl {
|
if ssl {
|
||||||
argGroup[i] = append(argGroup[i], sslServer2...)
|
argGroup[i] = append(argGroup[i], sslServer2...)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user