diff --git a/server/embed/config.go b/server/embed/config.go index 3fcf0128aa4b..0cb1a4b36d60 100644 --- a/server/embed/config.go +++ b/server/embed/config.go @@ -1162,14 +1162,28 @@ func (cfg *Config) InferLocalAddr() string { if !cfg.SetMemberLocalAddr { return "" } + + lg := cfg.GetLogger() + lg.Info( + "searching for a suitable member local address in AdvertisePeerURLs", + zap.Strings("advertise-peer-urls", cfg.getAdvertisePeerUrls()), + ) for _, peerURL := range cfg.AdvertisePeerUrls { if addr, err := netip.ParseAddr(peerURL.Hostname()); err == nil { if addr.IsLoopback() || addr.IsUnspecified() { continue } + lg.Info( + "setting member local address", + zap.String("LocalAddr", addr.String()), + ) return addr.String() } } + lg.Warn( + "unable to set a member local address due to lack of suitable local addresses", + zap.Strings("advertise-peer-urls", cfg.getAdvertisePeerUrls()), + ) return "" }