add
This commit is contained in:
20
2-生产环境4.0/负载均衡服务器/高负载均衡/check-lb-ip.sh
Normal file
20
2-生产环境4.0/负载均衡服务器/高负载均衡/check-lb-ip.sh
Normal 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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user