loop through all masters

This commit is contained in:
Chris Lu 2020-04-03 00:47:48 -07:00
parent 4a5e381feb
commit 6e776aaafc

View file

@ -130,13 +130,15 @@ func maybeStartMetrics(fs *FilerServer, option *FilerOption) {
var metricsIntervalSec int
var readErr error
for !isConnected {
metricsAddress, metricsIntervalSec, readErr = readFilerConfiguration(fs.grpcDialOption, option.Masters[0])
for _, master := range option.Masters {
metricsAddress, metricsIntervalSec, readErr = readFilerConfiguration(fs.grpcDialOption, master)
if readErr == nil {
isConnected = true
} else {
time.Sleep(7 * time.Second)
}
}
}
if metricsAddress == "" && metricsIntervalSec <= 0 {
return
}