From 6e776aaafc3c4655476786feb203981cb4b743ed Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Fri, 3 Apr 2020 00:47:48 -0700 Subject: [PATCH] loop through all masters --- weed/server/filer_server.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/weed/server/filer_server.go b/weed/server/filer_server.go index 9a84fac99..ba7b0ed03 100644 --- a/weed/server/filer_server.go +++ b/weed/server/filer_server.go @@ -130,11 +130,13 @@ func maybeStartMetrics(fs *FilerServer, option *FilerOption) { var metricsIntervalSec int var readErr error for !isConnected { - metricsAddress, metricsIntervalSec, readErr = readFilerConfiguration(fs.grpcDialOption, option.Masters[0]) - if readErr == nil { - isConnected = true - } else { - time.Sleep(7 * time.Second) + 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 {