| | |
| | | |
| | | //启动服务 |
| | | func StartServer(scriptPath string) { |
| | | fmt.Println("sh " + scriptPath + StartServerScript) |
| | | util.RunScript("sh " + scriptPath + StartServerScript) |
| | | //fmt.Println("sh " + scriptPath + "/" + StartServerScript) |
| | | util.RunScript("sh " + scriptPath + "/" + StartServerScript) |
| | | } |
| | | |
| | | //停止服务 |
| | | func StopServer(scriptPath string) { |
| | | fmt.Println("sh " + scriptPath + StopServerScript) |
| | | util.RunScript("sh " + scriptPath + StopServerScript) |
| | | //fmt.Println("sh " + scriptPath + "/" + StopServerScript) |
| | | util.RunScript("sh " + scriptPath + "/" + StopServerScript) |
| | | } |
| | | |
| | | //根据搜索内容替换整行内容 |
| | |
| | | //验证服务状态 |
| | | func Verification(startupItem string, ip string) bool { |
| | | resStatu := false |
| | | fmt.Println(startupItem) |
| | | switch startupItem { |
| | | case StartScriptAsVolume: |
| | | verificationVolumeUrl := "http://" + ip + ":6700" |
| | | verificationVolumeUrl := "http://" + ip + ":6700/ui/index.html" |
| | | _, volume1Err := http.Get(verificationVolumeUrl) |
| | | if volume1Err == nil { |
| | | resStatu = true |
| | |
| | | } |
| | | case StartScriptAsMaVo: |
| | | verificationMasterUrl := "http://" + ip + ":6333" |
| | | verificationVolumeUrl := "http://" + ip + ":6700" |
| | | verificationVolumeUrl := "http://" + ip + ":6700/ui/index.html" |
| | | _, masterErr := http.Get(verificationMasterUrl) |
| | | fmt.Println("masterErr", masterErr) |
| | | _, volume1Err := http.Get(verificationVolumeUrl) |
| | | fmt.Println("volume1Err", volume1Err) |
| | | if masterErr == nil && volume1Err == nil { |
| | | resStatu = true |
| | | } |