| agent.go | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| config.go | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
agent.go
@@ -60,6 +60,7 @@ NodeID string `json:"nodeID"` NodeAddress string `json:"nodeAddress"` IsAlive int `json:"isAlive"` Role string `json:"role"` } // Create create serf agent with config @@ -762,6 +763,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
@@ -137,7 +137,10 @@ 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