diff --git a/client/client.go b/client/client.go index a088d4d0b..d007fcb96 100644 --- a/client/client.go +++ b/client/client.go @@ -1248,11 +1248,8 @@ func (c *Client) setupConsulSyncer() error { // Nomad servers are available within // datacenterQueryLimit, the next heartbeat will pick // a new set of servers so it's okay. - nearestDC := dcs[0] - dcs = dcs[1:] - shuffleStrings(dcs) - otherDCs := dcs[0:lib.MinInt(len(dcs), datacenterQueryLimit)] - dcs = append([]string{nearestDC}, otherDCs...) + shuffleStrings(dcs[1:]) + dcs = dcs[0:lib.MinInt(len(dcs), datacenterQueryLimit)] } // Forward RPCs to our region diff --git a/nomad/server.go b/nomad/server.go index 5d3217b4a..9ba4045bd 100644 --- a/nomad/server.go +++ b/nomad/server.go @@ -469,11 +469,8 @@ func (s *Server) setupBootstrapHandler() error { // are necessary, this Nomad Server will eventually // walk all datacenter until it finds enough hosts to // form a quorum. - nearestDC := dcs[0] - dcs = dcs[1:] - shuffleStrings(dcs) - otherDCs := dcs[0:lib.MinInt(len(dcs), datacenterQueryLimit)] - dcs = append([]string{nearestDC}, otherDCs...) + shuffleStrings(dcs[1:]) + dcs = dcs[0:lib.MinInt(len(dcs), datacenterQueryLimit)] } nomadServerServiceName := s.config.ConsulConfig.ServerServiceName