This commit is contained in:
zeaslity
2024-10-30 16:30:51 +08:00
commit 437acbeb63
3363 changed files with 653948 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
#!/bin/bash
export log_file=/etc/keepalived/report.log
if [[ $( ip addr | grep -c "192.168.148.131") -eq 1 ]]; then
echo "当前主机为 主loadbalancer节点 当前时间为 $(date) " >> ${log_file}
echo "start to sync nginx conf to another loadbalancer" >> ${log_file}
rclone sync /etc/nginx/ loadbalancer:/etc/nginx/ >> ${log_file}
echo "start to reload the other loadbalancer nginx" >> ${log_file}
ssh loadbalancer "systemctl restart nginx"
echo "" >> ${log_file}
echo "----------------------------" >> ${log_file}
fi