| agent.go | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| config.go | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
agent.go
@@ -51,6 +51,7 @@ NodeID string `json:"nodeID"` NodeAddress string `json:"nodeAddress"` IsAlive int `json:"isAlive"` Role string `json:"role"` } // Create create serf agent with config @@ -406,6 +407,7 @@ node.NodeAddress = mb.Addr.String() + ":" + strconv.Itoa(int(mb.Port)) node.IsAlive = int(mb.Status) node.ClusterID = mb.Tags[tagKeyClusterID] node.Role = mb.Tags["role"] nodes = append(nodes, node) } config.go
@@ -163,7 +163,7 @@ serfConf.MemberlistConfig.BindPort = bindPort serfConf.NodeName = c.NodeName serfConf.Tags = map[string]string{TagKeyRPCPort: strconv.Itoa(c.RPCPort)} serfConf.Tags = map[string]string{TagKeyRPCPort: strconv.Itoa(c.RPCPort), "role": "slave"} if c.ClusterID != "" { serfConf.Tags[tagKeyClusterID] = c.ClusterID