addDnodeToCluster.sh 558 字节
Newer Older
P
plum-lihui 已提交
1 2 3 4 5 6 7 8
#!/bin/bash
#
# deploy test cluster

set -e
#set -x

dnodeNumber=1
P
plum-lihui 已提交
9
serverPort=6030
P
plum-lihui 已提交
10

P
plum-lihui 已提交
11
while getopts "hn:p:" arg
P
plum-lihui 已提交
12 13 14 15 16
do
  case $arg in
    n)
      dnodeNumber=$(echo $OPTARG)
      ;;
P
plum-lihui 已提交
17 18 19
    p)
      serverPort=$(echo $OPTARG)
      ;;
P
plum-lihui 已提交
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
    h)
      echo "Usage: `basename $0` -n [ dnode number] "
      exit 0
      ;;
    ?) #unknow option
      echo "unkonw argument"
      exit 1
      ;;
  esac
done

for ((i=2; i<=${dnodeNumber}; i++)); do
    taos -s "create dnode node${i} port ${serverPort};" ||:
    echo "create dnode node${i} port ${serverPort};"
done