github.com/pingcap/tiflow@v0.0.0-20240520035814-5bf52d54e205/tests/integration_tests/_utils/stop_tidb_cluster (about)

     1  #!/bin/bash
     2  
     3  # cdc server is ran by binary cdc.test, kill cdc server first to avoid too much
     4  # noise in cdc logs.
     5  
     6  PKILL="killall -q -w -s 9 "
     7  if [ "$(uname)" == "Darwin" ]; then
     8  	PKILL="pkill -9 "
     9  fi
    10  
    11  ${PKILL} cdc.test || true
    12  ${PKILL} cdc || true
    13  ${PKILL} cdc_kafka_consumer || true
    14  ${PKILL} cdc_storage_consumer || true
    15  ${PKILL} tidb-server || true
    16  ${PKILL} tikv-server || true
    17  ${PKILL} tiflash || true
    18  ${PKILL} flash_cluster_manager || true
    19  ${PKILL} pd-server || true
    20  ${PKILL} oauth_server || true
    21  
    22  CUR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
    23  source $CUR/../_utils/test_prepare
    24  
    25  kill -9 $(lsof -i tcp:${UP_TIDB_PORT} -t 2>/dev/null) &>/dev/null || true
    26  kill -9 $(lsof -i tcp:${UP_TIDB_OTHER_PORT} -t 2>/dev/null) &>/dev/null || true
    27  kill -9 $(lsof -i tcp:${UP_TIDB_STATUS} -t 2>/dev/null) &>/dev/null || true
    28  kill -9 $(lsof -i tcp:${UP_TIDB_OTHER_STATUS} -t 2>/dev/null) &>/dev/null || true
    29  kill -9 $(lsof -i tcp:${DOWN_TIDB_PORT} -t 2>/dev/null) &>/dev/null || true
    30  kill -9 $(lsof -i tcp:${DOWN_TIDB_STATUS} -t 2>/dev/null) &>/dev/null || true
    31  kill -9 $(lsof -i tcp:${UP_PD_PORT_1} -t 2>/dev/null) &>/dev/null || true
    32  kill -9 $(lsof -i tcp:${UP_PD_PEER_PORT_1} -t 2>/dev/null) &>/dev/null || true
    33  kill -9 $(lsof -i tcp:${UP_PD_PORT_2} -t 2>/dev/null) &>/dev/null || true
    34  kill -9 $(lsof -i tcp:${UP_PD_PEER_PORT_2} -t 2>/dev/null) &>/dev/null || true
    35  kill -9 $(lsof -i tcp:${UP_PD_PORT_3} -t 2>/dev/null) &>/dev/null || true
    36  kill -9 $(lsof -i tcp:${UP_PD_PEER_PORT_3} -t 2>/dev/null) &>/dev/null || true
    37  kill -9 $(lsof -i tcp:${DOWN_PD_PORT} -t 2>/dev/null) &>/dev/null || true
    38  kill -9 $(lsof -i tcp:${DOWN_PD_PEER_PORT} -t 2>/dev/null) &>/dev/null || true
    39  kill -9 $(lsof -i tcp:${UP_TIKV_PORT_1} -t 2>/dev/null) &>/dev/null || true
    40  kill -9 $(lsof -i tcp:${UP_TIKV_STATUS_PORT_1} -t 2>/dev/null) &>/dev/null || true
    41  kill -9 $(lsof -i tcp:${UP_TIKV_PORT_2} -t 2>/dev/null) &>/dev/null || true
    42  kill -9 $(lsof -i tcp:${UP_TIKV_STATUS_PORT_2} -t 2>/dev/null) &>/dev/null || true
    43  kill -9 $(lsof -i tcp:${UP_TIKV_PORT_3} -t 2>/dev/null) &>/dev/null || true
    44  kill -9 $(lsof -i tcp:${UP_TIKV_STATUS_PORT_3} -t 2>/dev/null) &>/dev/null || true
    45  kill -9 $(lsof -i tcp:${DOWN_TIKV_PORT} -t 2>/dev/null) &>/dev/null || true
    46  kill -9 $(lsof -i tcp:${DOWN_TIKV_STATUS_PORT} -t 2>/dev/null) &>/dev/null || true
    47  kill -9 $(lsof -i tcp:9500 -t 2>/dev/null) &>/dev/null || true
    48  kill -9 $(lsof -i tcp:17000 -t 2>/dev/null) &>/dev/null || true
    49  kill -9 $(lsof -i tcp:6650 -t 2>/dev/null) &>/dev/null || true
    50  kill -9 $(lsof -i tcp:6651 -t 2>/dev/null) &>/dev/null || true
    51  kill -9 $(lsof -i tcp:9096 -t 2>/dev/null) &>/dev/null || true