filer: add default log purging to master maintenance scripts (#8359)

* filer: add default log purging to master maintenance scripts

* filer: fix default maintenance scripts to include full set of tasks

* filer: refactor maintenance scripts to avoid duplication
This commit is contained in:
Chris Lu
2026-02-16 16:58:15 -08:00
committed by GitHub
parent bddd7960c1
commit 3300874cb5
4 changed files with 28 additions and 12 deletions

View File

@@ -1,6 +1,15 @@
package scaffold
import _ "embed"
import (
_ "embed"
"strings"
"github.com/seaweedfs/seaweedfs/weed/cluster/maintenance"
)
func init() {
Master = strings.ReplaceAll(masterTemplate, "{{DEFAULT_MAINTENANCE_SCRIPTS}}", maintenance.DefaultMasterMaintenanceScripts)
}
//go:embed filer.toml
var Filer string
@@ -15,6 +24,7 @@ var Replication string
var Security string
//go:embed master.toml
var masterTemplate string
var Master string
//go:embed shell.toml

View File

@@ -6,17 +6,7 @@
[master.maintenance]
# periodically run these scripts are the same as running them from 'weed shell'
scripts = """
lock
ec.encode -fullPercent=95 -quietFor=1h
ec.rebuild -apply
ec.balance -apply
volume.deleteEmpty -quietFor=24h -apply
volume.balance -apply
volume.fix.replication -apply
s3.clean.uploads -timeAgo=24h
unlock
"""
scripts = """{{DEFAULT_MAINTENANCE_SCRIPTS}}"""
sleep_minutes = 17 # sleep minutes between each script execution