diff --git a/cluster/cluster.go b/cluster/cluster.go index e3119527..48c7e5e2 100644 --- a/cluster/cluster.go +++ b/cluster/cluster.go @@ -197,6 +197,9 @@ func Join( if advertiseHost != "" { cfg.AdvertiseAddr = advertiseHost cfg.AdvertisePort = advertisePort + p.setInitialFailed(resolvedPeers, fmt.Sprintf("%s:%d", advertiseHost, advertisePort)) + } else { + p.setInitialFailed(resolvedPeers, bindAddr) } ml, err := memberlist.Create(cfg) @@ -205,8 +208,6 @@ func Join( } p.mlist = ml - p.setInitialFailed(resolvedPeers, fmt.Sprintf("%s:%d", advertiseHost, advertisePort)) - n, err := ml.Join(resolvedPeers) if err != nil { level.Warn(l).Log("msg", "failed to join cluster", "err", err)