lxl736321739
2022-07-11 a744a6be0cd5a84b30d53d28096b6a764105a437
ClusterApi.go
@@ -44,8 +44,7 @@
   if resultMsg == "运行失败" {
      return false
   }
   b := VerifyNodeServer(ip, port)
   return b
   return true
}
//关闭服务
@@ -56,6 +55,7 @@
      if resultMsg == "运行失败" {
         return true
      }
      time.Sleep(time.Second * 3)
   }
   bs := VerifyShortNodeServer(ip, port)
   return bs
@@ -83,7 +83,7 @@
}
//验证该节点是否被使用过
func VerifyCreated(configPath string, ip string) (bool, error) {
func VerifyCreated(configPath string) (bool, error) {
   v := viper.New()
   v.SetConfigType("yml")
   v.SetConfigName("elasticsearch")
@@ -100,7 +100,7 @@
}
//验证节点服务是否正常启动
func VerifyNodeServer(ip string, port string) bool {
func VerifyNodeServer(ip string, port string, waitTime int) bool {
   b := false
   url := "http://" + ip + ":" + port
   for i := 1; i < 3; i++ {
@@ -108,7 +108,7 @@
      if err != nil {
         b = false
         if i < 3 {
            time.Sleep(time.Second * 10)
            time.Sleep(time.Second * time.Duration(waitTime))
            continue
         }
      } else {