实现节点自动切换到备用IP

This commit is contained in:
刘祥超
2021-09-13 10:51:05 +08:00
parent 7fcc2b7dba
commit 0b8501a724
14 changed files with 112 additions and 39 deletions

View File

@@ -792,6 +792,17 @@ func (this *NodeClusterDAO) FindEnabledNodeClustersWithIds(tx *dbs.Tx, clusterId
return
}
// ExistsEnabledCluster 检查集群是否存在
func (this *NodeClusterDAO) ExistsEnabledCluster(tx *dbs.Tx, clusterId int64) (bool, error) {
if clusterId <= 0 {
return false, nil
}
return this.Query(tx).
Pk(clusterId).
State(NodeClusterStateEnabled).
Exist()
}
// NotifyUpdate 通知更新
func (this *NodeClusterDAO) NotifyUpdate(tx *dbs.Tx, clusterId int64) error {
return SharedNodeTaskDAO.CreateClusterTask(tx, nodeconfigs.NodeRoleNode, clusterId, NodeTaskTypeConfigChanged)