diff --git a/internal/app/dfs_test.go b/internal/app/dfs_test.go index 6319cd3..8037591 100644 --- a/internal/app/dfs_test.go +++ b/internal/app/dfs_test.go @@ -28,7 +28,7 @@ func TestDfs(t *testing.T) { config2.Storage.HTTPScheme = "http" config2.Storage.Group = "group1" config2.Storage.StoragePath = "./dfs/1" - config2.Storage.TrackerServers = []string{"http://127.0.0.1:9000"} + config2.Storage.Tracker = []string{"http://127.0.0.1:9000"} go Start(&config2) // 启动storage @@ -40,7 +40,7 @@ func TestDfs(t *testing.T) { config3.Storage.HTTPScheme = "http" config3.Storage.Group = "group1" config3.Storage.StoragePath = "./dfs/2" - config3.Storage.TrackerServers = []string{"http://127.0.0.1:9000"} + config3.Storage.Tracker = []string{"http://127.0.0.1:9000"} go Start(&config3) <-make(chan bool) diff --git a/internal/app/storage.go b/internal/app/storage.go index ba4bbce..de49bb0 100644 --- a/internal/app/storage.go +++ b/internal/app/storage.go @@ -188,7 +188,7 @@ func (s *Storage) ReportStatus() { } // 获取容量信息 // 获取负载信息 - for _, url := range s.ServerConfig.Storage.TrackerServers { + for _, url := range s.ServerConfig.Storage.Tracker { pkg.Helper{}.PostJSON(url+"/report-status", data, nil, 10*time.Second) } } @@ -200,7 +200,7 @@ func (s *Storage) ReportErrorMsg(msg string) { Port string Msg string } - for _, url := range s.ServerConfig.Storage.TrackerServers { + for _, url := range s.ServerConfig.Storage.Tracker { pkg.Helper{}.PostJSON(url+"/report-err", errMsg{ Group: s.ServerConfig.Storage.Group, diff --git a/internal/pkg/config.go b/internal/pkg/config.go index e841912..48c128d 100644 --- a/internal/pkg/config.go +++ b/internal/pkg/config.go @@ -28,7 +28,7 @@ type DsfConfigType struct { // storagePath StoragePath string `mapstructure:"storage_path"` // trackerServers,can be one or more - TrackerServers []string `mapstructure:"tracker_servers"` + Tracker []string `mapstructure:"tracker"` } `mapstructure:"storage"` }