This is an automated email from the ASF dual-hosted git repository.

zhongxjian pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-kubernetes.git


The following commit(s) were added to refs/heads/master by this push:
     new eb558360 [horus] Reboot strategy complete implementation (#417)
eb558360 is described below

commit eb558360ff3ef99e995f4a9dc0fb46a892e7371b
Author: mfordjody <[email protected]>
AuthorDate: Wed Oct 2 14:28:41 2024 +0800

    [horus] Reboot strategy complete implementation (#417)
---
 app/horus/core/horuser/node_restart.go | 7 ++++++-
 app/horus/core/horuser/restart.sh      | 6 +++---
 manifests/horus/horus.yaml             | 2 +-
 3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/app/horus/core/horuser/node_restart.go 
b/app/horus/core/horuser/node_restart.go
index 06e1c069..c4eb13a9 100644
--- a/app/horus/core/horuser/node_restart.go
+++ b/app/horus/core/horuser/node_restart.go
@@ -76,8 +76,13 @@ func (h *Horuser) TryRestart(node db.NodeDataInfo) {
                        klog.Errorf("Failed restart for Output: %v node %v: 
%v", string(output), node.NodeName, err)
                        return
                }
-               klog.Infof("Successfully restarted node %v. Output: %v", 
node.NodeName, string(output))
+               klog.Infof("Successfully restarted node %v.", node.NodeName)
        } else {
                klog.Infof("RestartMarker did not pass for node %v", 
node.NodeName)
        }
+
+       if node.Restart < 2 {
+               klog.Info("It's been rebooted once.")
+               return
+       }
 }
diff --git a/app/horus/core/horuser/restart.sh 
b/app/horus/core/horuser/restart.sh
index 19784a24..1523b68d 100644
--- a/app/horus/core/horuser/restart.sh
+++ b/app/horus/core/horuser/restart.sh
@@ -16,8 +16,8 @@
 # limitations under the License.
 
 host_computer=$1
-host_name=$2
-host_pass=$3
+host_username=$2
+host_password=$3
 
 if [ $# -lt 3 ]; then
   echo "ERROR: The expected value is parameter 3, but there are only $#: input 
parameters."
@@ -25,5 +25,5 @@ if [ $# -lt 3 ]; then
 fi
 
 for i in $host_computer; do
-    sshpass -p "$host_pass" ssh "$host_name"@$i -o "StrictHostKeyChecking=no" 
"echo $host_pass | sudo -S reboot"
+    sshpass -p "$host_password" ssh "$host_username"@$i -o 
"StrictHostKeyChecking=no" "echo $host_password | sudo -S reboot"
 done
diff --git a/manifests/horus/horus.yaml b/manifests/horus/horus.yaml
index 836a92b5..a8cb0937 100644
--- a/manifests/horus/horus.yaml
+++ b/manifests/horus/horus.yaml
@@ -83,7 +83,7 @@ nodeDownTime:
   abnormalInfoSystemQL:
     node_os_info{node="%s"}
   allSystemUser: "zxj"
-  AllSystemPassword: "1"
+  allSystemPassword: "1"
   kubeMultiple:
     cluster: config.1
   dingTalk:

Reply via email to