stop_dnodes.sh 870 字节
Newer Older
S
slguan 已提交
1 2
#!/bin/sh

G
Ganlin Zhao 已提交
3 4 5
UNAME_BIN=`which uname`
OS_TYPE=`$UNAME_BIN`

S
slguan 已提交
6
PID=`ps -ef|grep /usr/bin/taosd | grep -v grep | awk '{print $2}'`
G
Ganlin Zhao 已提交
7 8 9
if [ -n "$PID" ]; then
  echo systemctl stop taosd
  systemctl stop taosd
S
slguan 已提交
10
fi
G
Ganlin Zhao 已提交
11

12
PID=`ps -ef|grep -w taosd | grep -v grep | awk '{print $2}'`
13
while [ -n "$PID" ]; do
G
Ganlin Zhao 已提交
14 15 16
  echo kill -9 $PID
  pkill -9 taosd
  echo "Killing processes locking on port 6030"
H
Haojun Liao 已提交
17
  if [ "$OS_TYPE" != "Darwin" ]; then
G
Ganlin Zhao 已提交
18 19 20 21
    fuser -k -n tcp 6030
  else
    lsof -nti:6030 | xargs kill -9
  fi
22 23
  PID=`ps -ef|grep -w taosd | grep -v grep | awk '{print $2}'`
done
H
Hui Li 已提交
24 25 26

PID=`ps -ef|grep -w tarbitrator | grep -v grep | awk '{print $2}'`
while [ -n "$PID" ]; do
G
Ganlin Zhao 已提交
27 28
  echo kill -9 $PID
  pkill -9 tarbitrator
H
Haojun Liao 已提交
29
  if [ "$OS_TYPE" != "Darwin" ]; then
G
Ganlin Zhao 已提交
30 31 32 33
    fuser -k -n tcp 6040
  else
    lsof -nti:6040 | xargs kill -9
  fi
H
Hui Li 已提交
34 35 36
  PID=`ps -ef|grep -w tarbitrator | grep -v grep | awk '{print $2}'`
done