Browse Source

add s3.clean.uploads -timeAgo=24h

pull/2527/head
Chris Lu 3 years ago
parent
commit
3d7390302d
  1. 1
      weed/command/scaffold/master.toml
  2. 21
      weed/server/master_server.go

1
weed/command/scaffold/master.toml

@ -14,6 +14,7 @@ scripts = """
volume.deleteEmpty -quietFor=24h -force
volume.balance -force
volume.fix.replication
s3.clean.uploads -timeAgo=24h
unlock
"""
sleep_minutes = 17 # sleep minutes between each script execution

21
weed/server/master_server.go

@ -2,8 +2,6 @@ package weed_server
import (
"fmt"
"github.com/chrislusf/seaweedfs/weed/cluster"
"github.com/chrislusf/seaweedfs/weed/pb"
"net/http"
"net/http/httputil"
"net/url"
@ -13,6 +11,9 @@ import (
"sync"
"time"
"github.com/chrislusf/seaweedfs/weed/cluster"
"github.com/chrislusf/seaweedfs/weed/pb"
"github.com/chrislusf/raft"
"github.com/gorilla/mux"
"google.golang.org/grpc"
@ -210,10 +211,20 @@ func (ms *MasterServer) startAdminScripts() {
v := util.GetViper()
adminScripts := v.GetString("master.maintenance.scripts")
glog.V(0).Infof("adminScripts:\n%v", adminScripts)
if adminScripts == "" {
return
}
adminScripts = `
lock
ec.encode -fullPercent=95 -quietFor=1h
ec.rebuild -force
ec.balance -force
volume.deleteEmpty -quietFor=24h -force
volume.balance -force
volume.fix.replication
s3.clean.uploads -timeAgo=24h
unlock
`
}
glog.V(0).Infof("adminScripts: %v", adminScripts)
v.SetDefault("master.maintenance.sleep_minutes", 17)
sleepMinutes := v.GetInt("master.maintenance.sleep_minutes")

Loading…
Cancel
Save