diff --git a/dbm-services/redis/db-tools/dbactuator/pkg/atomjobs/atomproxy/predixy_config_servers_rewrite.go b/dbm-services/redis/db-tools/dbactuator/pkg/atomjobs/atomproxy/predixy_config_servers_rewrite.go index 294edf07b1..ff490f61eb 100644 --- a/dbm-services/redis/db-tools/dbactuator/pkg/atomjobs/atomproxy/predixy_config_servers_rewrite.go +++ b/dbm-services/redis/db-tools/dbactuator/pkg/atomjobs/atomproxy/predixy_config_servers_rewrite.go @@ -80,7 +80,7 @@ func (job *PredixyConfServersRewrite) Run() (err error) { var password string password, err = myredis.GetPredixyAdminPasswdFromConfFlie(job.params.PredixyPort) if err != nil { - return nil + return } err = job.newConn(password) if err != nil { diff --git a/dbm-services/redis/db-tools/dbactuator/pkg/atomjobs/atomredis/clustermeet_slotsassign.go b/dbm-services/redis/db-tools/dbactuator/pkg/atomjobs/atomredis/clustermeet_slotsassign.go index 0d4d6e14a3..d2db872832 100644 --- a/dbm-services/redis/db-tools/dbactuator/pkg/atomjobs/atomredis/clustermeet_slotsassign.go +++ b/dbm-services/redis/db-tools/dbactuator/pkg/atomjobs/atomredis/clustermeet_slotsassign.go @@ -179,24 +179,35 @@ func (job *ClusterMeetSlotsAssign) AddInstsToCluster() (err error) { firstIP := job.params.ReplicaPairs[0].MasterIP firstPort := job.params.ReplicaPairs[0].MasterPort firstCli := job.AddrMapCli[firstAddr] - addrMap, err := firstCli.GetAddrMapToNodes() - if err != nil { - return - } - for add01, cli := range job.AddrMapCli { - if add01 == firstAddr { + var addrMap map[string]*myredis.ClusterNodeData + maxRetryTimes := 5 + for maxRetryTimes >= 0 { + maxRetryTimes-- + isAllNodesKnown := true // 是否所有节点都被firstNode认识 + addrMap, err = firstCli.GetAddrMapToNodes() + if err != nil { continue } - node01, ok := addrMap[add01] - if ok && myredis.IsRunningNode(node01) { - continue + for add01, cli := range job.AddrMapCli { + if add01 == firstAddr { + continue + } + node01, ok := addrMap[add01] + if ok && myredis.IsRunningNode(node01) { + continue + } + isAllNodesKnown = false // 存在节点未被firstNode认识 + job.runtime.Logger.Info("redis(%s) cluster meet %s:%d", cli.Addr, firstIP, firstPort) + _, err = cli.ClusterMeet(firstIP, strconv.Itoa(firstPort)) + if err != nil { + return + } } - _, err = cli.ClusterMeet(firstIP, strconv.Itoa(firstPort)) - if err != nil { - return + if isAllNodesKnown { + break } + time.Sleep(10 * time.Second) } - time.Sleep(10 * time.Second) job.runtime.Logger.Info("all redis instances add to cluster") return nil } diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/proxy_install.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/proxy_install.py index 0929fc7f82..adb08629db 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/proxy_install.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/proxy_install.py @@ -124,7 +124,10 @@ def ProxyBatchInstallAtomJob( act_kwargs.cluster["dbconfig"] = param["conf_configs"] # 从dbconfig中获取load_modules cluster = Cluster.objects.get(immute_domain=act_kwargs.cluster["immute_domain"]) - load_modules = get_cluster_redis_modules_detial(cluster_id=cluster.id) + load_modules = [] + module_rows = get_cluster_redis_modules_detial(cluster_id=cluster.id) + for module_row in module_rows: + load_modules.append(module_row["module_name"]) # 安装proxy实例 if act_kwargs.cluster["cluster_type"] in [