mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Make nodenames unique in Gossip cluster
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
This commit is contained in:
parent
4e9df02c8f
commit
5b632d752c
1 changed files with 5 additions and 1 deletions
|
@ -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"
|
||||
|
@ -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,
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue