瀏覽代碼

Increase sleep interval in the bootstrap script

Because the current timeout interval is too short in some environments.
The change also adds information messages to bootstrap scripts

Change-Id: I295da792349f5864a484e3eb318342dcc31fffab
pull/25/head
Simon Pasquier 7 年之前
父節點
當前提交
2b501f112d
共有 2 個檔案被更改,包括 11 行新增3 行删除
  1. +6
    -2
      galera/files/bootstrap.sh
  2. +5
    -1
      galera/files/init_bootstrap.sh

+ 6
- 2
galera/files/bootstrap.sh 查看文件

@@ -3,15 +3,19 @@
service {{ service.service }} start

counter=60
retries=0

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

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

+ 5
- 1
galera/files/init_bootstrap.sh 查看文件

@@ -3,15 +3,19 @@
service {{ service.service }} start

counter=60
retries=0

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

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

Loading…
取消
儲存