2023-04-27 11:39:30 +08:00
|
|
|
#!/bin/bash
|
2023-09-12 17:20:40 +08:00
|
|
|
set -euo pipefail
|
2023-04-27 11:39:30 +08:00
|
|
|
|
2023-09-12 17:20:40 +08:00
|
|
|
source .env
|
2023-04-27 11:39:30 +08:00
|
|
|
|
2023-09-12 17:40:05 +08:00
|
|
|
# 生成keepalived配置文件
|
2023-09-12 17:20:40 +08:00
|
|
|
sed -e "s/__MASTER1__/${MASTER1}/g" \
|
|
|
|
-e "s/__MASTER2__/${MASTER2}/g" \
|
|
|
|
-e "s/__MASTER3__/${MASTER3}/g" \
|
|
|
|
-e "s/__VIP__/${VIP}/g" \
|
|
|
|
-i keepalived/*.conf
|
|
|
|
|
2023-09-12 17:40:05 +08:00
|
|
|
# 修改脚本内VIP
|
2023-09-12 23:12:13 +08:00
|
|
|
sed -e "s/__API_SERVER__/${VIP}/g" -i create_cluster.sh
|
2023-09-12 17:40:05 +08:00
|
|
|
|