File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed
Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change 3333# Execute the main process
3434/usr/libexec/oceanbase/scripts/seekdb_systemd_start
3535
36+ OBSERVER_CONFIG_FILE=" /var/lib/oceanbase/etc/observer.config.bin"
37+ for i in {1..10}; do
38+ echo " Loop iteration #$i "
39+ if [ -f " $OBSERVER_CONFIG_FILE " ]; then
40+ echo " File '$OBSERVER_CONFIG_FILE ' found on attempt #$i ."
41+ break
42+ fi
43+ sleep 1
44+ done
45+ obshell agent start --seekdb --base-dir=/var/lib/oceanbase
46+
3647INITIALIZED_FLAG=" /var/lib/oceanbase/.initialized"
3748
3849if [ ! -f " $INITIALIZED_FLAG " ]; then
3950 # change password using obshell
40- curl -X PUT " http://127.0.0.1:2886/api/v1/observer/user/root/password" -d " {\" password\" :\" $ROOT_PASSWORD \" }" --unix-socket " /var/lib/oceanbase/run/obshell.sock"
51+ for i in {1..10}; do
52+ curl -X PUT " http://127.0.0.1:2886/api/v1/observer/user/root/password" -d " {\" password\" :\" $ROOT_PASSWORD \" }" --unix-socket " /var/lib/oceanbase/run/obshell.sock"
53+ EXIT_STATUS=$?
54+ if [ $EXIT_STATUS -eq 0 ]; then
55+ echo " Command succeeded on attempt #$i ."
56+ break # Exit the loop if successful
57+ else
58+ echo " Command failed on attempt #$i (exit status: $EXIT_STATUS ). Retrying in 1 seconds..."
59+ sleep 1
60+ fi
61+ done
4162
4263 # Execute initialization scripts if INIT_SCRIPTS_PATH is set
4364 if [ -n " $INIT_SCRIPTS_PATH " ]; then
You can’t perform that action at this time.
0 commit comments