github.com/pingcap/tiflow@v0.0.0-20240520035814-5bf52d54e205/engine/test/utils/start_engine_cluster (about)

     1  #!/bin/bash
     2  
     3  if [ $# -eq 0 ]; then
     4  	echo "<<<<<< can not deploy engine cluster using empty config >>>>>>"
     5  	exit 1
     6  fi
     7  echo "start deploying engine cluster..."
     8  
     9  retry_times=3
    10  i=1
    11  while [ $i -le $retry_times ]; do
    12  	echo "The ${i} times to try to start engine cluster..."
    13  	run_engine.sh deploy "$@" && break
    14  	((i++)) || true
    15  	run_engine.sh stop "$@" || true
    16  	echo "start engine cluster failed, retry later..."
    17  	sleep 3
    18  done
    19  
    20  if [ $i -gt $retry_times ]; then
    21  	echo -e "\n\n[$(date)] <<<<<< fail to start engine cluster after $retry_times times >>>>>>"
    22  	exit 1
    23  else
    24  	# TODO: add check logic to wait cluster ready
    25  	sleep 5
    26  fi