diff --git a/consul/client.go b/consul/client.go index 6cfeb98712..5f9fc99063 100644 --- a/consul/client.go +++ b/consul/client.go @@ -153,7 +153,7 @@ func (c *Client) Leave() error { // The target address should be another node inside the DC // listening on the Serf LAN address func (c *Client) JoinLAN(addrs []string) (int, error) { - return c.serf.Join(addrs, false) + return c.serf.Join(addrs, true) } // LANMembers is used to return the members of the LAN cluster diff --git a/consul/server.go b/consul/server.go index 91041dfdd5..00fdcd5f41 100644 --- a/consul/server.go +++ b/consul/server.go @@ -381,7 +381,7 @@ func (s *Server) Leave() error { ch := make(chan error, 1) go func() { var out struct{} - peer := s.rpcListener.Addr().String() + peer := s.raftTransport.LocalAddr().String() err := s.connPool.RPC(leader, "Raft.RemovePeer", peer, &out) ch <- err }() @@ -404,14 +404,14 @@ AFTER_LEAVE: // The target address should be another node inside the DC // listening on the Serf LAN address func (s *Server) JoinLAN(addrs []string) (int, error) { - return s.serfLAN.Join(addrs, false) + return s.serfLAN.Join(addrs, true) } // JoinWAN is used to have Consul join the cross-WAN Consul ring // The target address should be another node listening on the // Serf WAN address func (s *Server) JoinWAN(addrs []string) (int, error) { - return s.serfWAN.Join(addrs, false) + return s.serfWAN.Join(addrs, true) } // LANMembers is used to return the members of the LAN cluster