Check for advertise host when setting failed peers (#1411)
When setting initially failing peers, if we don't have a value for the advertise address, use the bindAddr. Signed-off-by: stuart nelson <stuartnelson3@gmail.com>
This commit is contained in:
parent
ec2cc57d28
commit
d259bf9d09
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue