From 832b4c1694464fa153f1157f8cc1485edcd70f90 Mon Sep 17 00:00:00 2001 From: sunty <1172534965@qq.com> Date: 星期一, 19 十月 2020 16:31:49 +0800 Subject: [PATCH] add pid server --- ClusterApi.go | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ClusterApi.go b/ClusterApi.go index 116166a..f4a5a5d 100644 --- a/ClusterApi.go +++ b/ClusterApi.go @@ -30,25 +30,25 @@ } //鍚姩鏈嶅姟 -func StartServer(binPath string, ip string) bool { - resultMsg := CMDSC("sh " + binPath + "/elasticsearch -d") +func StartServer(binPath string, ip string, port string) bool { + resultMsg := CMDSC("sh " + binPath + "/es_start.sh") if resultMsg == "杩愯澶辫触" { return false } - bool := VerifyNodeServer(ip, "9200") - return bool + b := VerifyNodeServer(ip, port) + return b } //鍏抽棴鏈嶅姟 -func StopServer(pidPath string, ip string, port string) bool { - bool := VerifyShortNodeServer(ip, port) - if bool == true { - resultMsg := CMDSC("kill `cat " + pidPath + "pid`") +func StopServer(binPath string, ip string, port string) bool { + b := VerifyShortNodeServer(ip, port) + if b == true { + resultMsg := CMDSC("sh " + binPath + "/es_stop.sh") if resultMsg == "杩愯澶辫触" { return false } } - return true + return b } //鏇存崲鑺傜偣瑙掕壊 -- Gitblit v1.8.0