| | |
| | | } |
| | | script.ReplaceLineContentBySearch(config.Option+config.StartScriptAsVolume, config.Option, config.Server.ScriptPath, config.StartServerScript) |
| | | script.ReplaceLineContentBySearch(es.GetNewPeers(), config.Peer, config.Server.ScriptPath, config.StartServerScript) |
| | | script.StopServer(config.Server.ScriptPath) |
| | | script.StartServer(config.Server.ScriptPath) |
| | | return true |
| | | } |
| | |
| | | fmt.Println("重启当前组服务" + ip) |
| | | if (i+1)%coreThread == 0 { |
| | | masterIp = append(masterIp, strings.Split(ip, ":")[0]) |
| | | fmt.Println("加入第一组并开始验证第一组 masterIp: ", masterIp) |
| | | fmt.Println("验证当前组 masterIp 成员: ", masterIp) |
| | | for i := 0; i < len(masterIp); i++ { |
| | | fmt.Println("len masterIp: ", len(masterIp)) |
| | | fmt.Println("第" + strconv.Itoa(i) + "个线程") |
| | | fmt.Println("当前goroutinebe") |
| | | //fmt.Println("当前goroutinebe") |
| | | waitGroup.Add(1) //每创建一个goroutine,就把任务队列中任务的数量+1 |
| | | fmt.Println("当前goroutineaf") |
| | | //fmt.Println("当前goroutineaf") |
| | | go Restart(masterIp[i], timeOut) |
| | | waitGroup.Done() |
| | | } |
| | |
| | | break |
| | | } |
| | | } |
| | | |
| | | } |
| | | fmt.Println("服务流程执行完毕") |
| | | |