Skip to content

Commit

Permalink
Merge pull request #1451 from sanimej/name
Browse files Browse the repository at this point in the history
Make nodenames unique in Gossip cluster
  • Loading branch information
mrjana authored Sep 19, 2016
2 parents d2141cd + 82fba3c commit 011cc73
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.Info("Gossip cluster hostname ", nodeName)

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

Expand Down

0 comments on commit 011cc73

Please sign in to comment.