浏览代码

Merge pull request #28 from salt-formulas/feature/tunne_bootstrapscrips

Tune bootstrap scripts
master
Aleš Komárek 6 年前
父节点
当前提交
a71c8901ff
没有帐户链接到提交者的电子邮件
共有 2 个文件被更改,包括 6 次插入8 次删除
  1. +3
    -4
      galera/files/bootstrap.sh
  2. +3
    -4
      galera/files/init_bootstrap.sh

+ 3
- 4
galera/files/bootstrap.sh 查看文件

@@ -2,19 +2,18 @@

service {{ service.service }} start

counter=60
counter=${1:-60}
retries=0

while [ $counter -gt 0 ]
do
mysql -u {{ service.admin.user }} -p{{ service.admin.password }} -e"quit"
if [[ $? -eq 0 ]]; then
if mysql -u {{ service.admin.user }} -p{{ service.admin.password }} -e"quit"; then
echo "Sucessfully connected to the MySQL service ($retries retries)."
exit 0
fi
counter=$(( counter - 1 ))
retries=$(( retries + 1 ))
sleep 4
sleep ${2:-10}
done

echo "Failed to connect to the MySQL service after $retries retries."

+ 3
- 4
galera/files/init_bootstrap.sh 查看文件

@@ -2,19 +2,18 @@

service {{ service.service }} start

counter=60
counter=${1:-60}
retries=0

while [ $counter -gt 0 ]
do
mysql -u root -e"quit" || mysql -u {{ service.admin.user }} -p{{ service.admin.password }} -e"quit"
if [[ $? -eq 0 ]]; then
if mysql -u root -e"quit" || mysql -u {{ service.admin.user }} -p{{ service.admin.password }} -e"quit"; then
echo "Sucessfully connected to the MySQL service ($retries retries)."
exit 0
fi
counter=$(( counter - 1 ))
retries=$(( retries + 1 ))
sleep 2
sleep ${2:-10}
done

echo "Failed to connect to the MySQL service after $retries retries."

正在加载...
取消
保存