Skip to content

Commit

Permalink
Make nodenames unique in Gossip cluster
Browse files Browse the repository at this point in the history
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
  • Loading branch information
Santhosh Manohar committed Sep 19, 2016
1 parent c8ce8c7 commit 3247ed1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"sort"

"github.com/Sirupsen/logrus"
"github.com/docker/docker/pkg/stringid"
"github.com/docker/go-events"
"github.com/docker/libnetwork/datastore"
"github.com/docker/libnetwork/discoverapi"
Expand Down Expand Up @@ -247,9 +248,12 @@ func (c *controller) agentInit(bindAddrOrInterface, advertiseAddr string) error

keys, tags := c.getKeys(subsysGossip)
hostname, _ := os.Hostname()
nodeName := hostname + "-" + stringid.TruncateID(stringid.GenerateRandomID())
logrus.Infof("Gossip cluster hostname ", nodeName)

nDB, err := networkdb.New(&networkdb.Config{
AdvertiseAddr: advertiseAddr,
NodeName: hostname,
NodeName: nodeName,
Keys: keys,
})

Expand Down

0 comments on commit 3247ed1

Please sign in to comment.