mirror of https://github.com/status-im/consul.git
consul: Reduce the number of raft snapshots we keep
This commit is contained in:
parent
5e790b02a9
commit
e54d8f6c07
|
@ -14,9 +14,10 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
serfLANSnapshot = "serf/local.snapshot"
|
serfLANSnapshot = "serf/local.snapshot"
|
||||||
serfWANSnapshot = "serf/remote.snapshot"
|
serfWANSnapshot = "serf/remote.snapshot"
|
||||||
raftState = "raft/"
|
raftState = "raft/"
|
||||||
|
snapshotsRetained = 2
|
||||||
)
|
)
|
||||||
|
|
||||||
// Server is Consul server which manages the service discovery,
|
// Server is Consul server which manages the service discovery,
|
||||||
|
@ -207,7 +208,7 @@ func (s *Server) setupRaft() error {
|
||||||
s.raftStore = store
|
s.raftStore = store
|
||||||
|
|
||||||
// Create the snapshot store
|
// Create the snapshot store
|
||||||
snapshots, err := raft.NewFileSnapshotStore(path, 3, s.config.LogOutput)
|
snapshots, err := raft.NewFileSnapshotStore(path, snapshotsRetained, s.config.LogOutput)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
store.Close()
|
store.Close()
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in New Issue