|
|
@ -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") |
|
|
|