Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
c4e0e94f
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
c4e0e94f
编写于
1月 18, 2022
作者:
P
plum-lihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[add create table scriptes]
上级
7c77464d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
299 addition
and
0 deletion
+299
-0
tests/script/sh/massiveTable/cleanCluster.sh
tests/script/sh/massiveTable/cleanCluster.sh
+57
-0
tests/script/sh/massiveTable/compileVersion.sh
tests/script/sh/massiveTable/compileVersion.sh
+81
-0
tests/script/sh/massiveTable/deployCluster.sh
tests/script/sh/massiveTable/deployCluster.sh
+25
-0
tests/script/sh/massiveTable/setupDnodes.sh
tests/script/sh/massiveTable/setupDnodes.sh
+136
-0
未找到文件。
tests/script/sh/massiveTable/cleanCluster.sh
0 → 100644
浏览文件 @
c4e0e94f
#!/bin/bash
#
# clean test environment
set
-e
#set -x
# cleanCluster.sh
# -r [ dnode root dir]
dataRootDir
=
"/data"
while
getopts
"hr:"
arg
do
case
$arg
in
r
)
dataRootDir
=
$(
echo
$OPTARG
)
;;
h
)
echo
"Usage:
`
basename
$0
`
-r [ dnode root dir] "
exit
0
;;
?
)
#unknow option
echo
"unkonw argument"
exit
1
;;
esac
done
rmDnodesDataDir
()
{
if
[
-d
${
dataRootDir
}
]
;
then
rm
-rf
${
dataRootDir
}
/dnode
*
else
echo
"
${
dataRootDir
}
not exist"
exit
1
fi
}
function
kill_process
()
{
pid
=
$(
ps
-ef
|
grep
"
$1
"
|
grep
-v
"grep"
|
awk
'{print $2}'
)
if
[
-n
"
$pid
"
]
;
then
kill
-9
$pid
||
:
fi
}
########################################################################################
############################### main process ##########################################
## kill all taosd process
kill_process taosd
rmDnodesDataDir
tests/script/sh/massiveTable/compileVersion.sh
0 → 100644
浏览文件 @
c4e0e94f
#!/bin/bash
#
# compile test version
set
-e
#set -x
# compileVersion.sh
# -r [ TDengine project dir]
# -v [ TDengine branch version ]
projectDir
=
/root/TDengine
TDengineBrVer
=
"3.0"
while
getopts
"hr:v:"
arg
do
case
$arg
in
r
)
projectDir
=
$(
echo
$OPTARG
)
;;
v
)
TDengineBrVer
=
$(
echo
$OPTARG
)
;;
h
)
echo
"Usage:
`
basename
$0
`
-r [ TDengine project dir] "
echo
" -v [ TDengine branch version] "
exit
0
;;
?
)
#unknow option
echo
"unkonw argument"
exit
1
;;
esac
done
echo
"projectDir=
${
projectDir
}
TDengineBrVer=
${
TDengineBrVer
}
"
function
gitPullBranchInfo
()
{
branch_name
=
$1
git checkout
$branch_name
echo
"==== git pull
$branch_name
start ===="
## git submodule update --init --recursive
git pull origin
$branch_name
||
:
echo
"==== git pull
$branch_name
end ===="
}
function
compileTDengineVersion
()
{
debugDir
=
debug
if
[
-d
${
debugDir
}
]
;
then
rm
-rf
${
debugDir
}
/
*
||
:
else
mkdir
-p
${
debugDir
}
fi
cd
${
debugDir
}
cmake ..
make
-j24
}
########################################################################################
############################### main process ##########################################
## checkout all branchs and git pull
cd
${
projectDir
}
gitPullBranchInfo
$TDengineBrVer
compileTDengineVersion
taos_dir
=
${
projectDir
}
/debug/tools/shell
taosd_dir
=
${
projectDir
}
/debug/source/dnode/mgmt/daemon
create_table_dir
=
${
projectDir
}
/debug/tests/test/c
rm
-f
/usr/bin/taos
rm
-f
/usr/bin/taosd
rm
-f
/usr/bin/create_table
ln
-s
$taos_dir
/taos /usr/bin/taos
ln
-s
$taosd_dir
/taosd /usr/bin/taosd
ln
-s
$create_table_dir
/create_table /usr/bin/create_table
tests/script/sh/massiveTable/deployCluster.sh
0 → 100644
浏览文件 @
c4e0e94f
#!/bin/bash
#
# deploy test cluster
set
-e
#set -x
# deployCluster.sh
curr_dir
=
$(
pwd
)
source
./cleanCluster.sh
-r
/data
source
./cleanCluster.sh
-r
/data2
source
./compileVersion.sh
-r
${
curr_dir
}
/../../../../
-v
"3.0"
source
./setupDnodes.sh
-r
/data
-n
1
-f
trd02:7000
-p
7000
source
./setupDnodes.sh
-r
/data2
-n
1
-f
trd02:7000
-p
8000
#source ./setupDnodes.sh -r /data -n 2 -f trd02:7000 -p 7000
#source ./setupDnodes.sh -r /data2 -n 2 -f trd02:7000 -p 8000
tests/script/sh/massiveTable/setupDnodes.sh
0 → 100644
浏览文件 @
c4e0e94f
#!/bin/bash
#
# setup test environment
set
-e
#set -x
# setupDnodes.sh
# -e [ new | old]
# -n [ dnode number]
# -f [ first ep]
# -p [ start port]
# -r [ dnode root dir]
# set parameters by default value
enviMode
=
new
dataRootDir
=
"/data"
firstEp
=
"localhost:7000"
startPort
=
7000
dnodeNumber
=
1
while
getopts
"he:f:n:r:p:"
arg
do
case
$arg
in
e
)
enviMode
=
$(
echo
$OPTARG
)
;;
n
)
dnodeNumber
=
$(
echo
$OPTARG
)
;;
f
)
firstEp
=
$(
echo
$OPTARG
)
;;
p
)
startPort
=
$(
echo
$OPTARG
)
;;
r
)
dataRootDir
=
$(
echo
$OPTARG
)
;;
h
)
echo
"Usage:
`
basename
$0
`
-e [new | old] "
echo
" -n [ dnode number] "
echo
" -f [ first ep] "
echo
" -p [ start port] "
echo
" -r [ dnode root dir] "
exit
0
;;
?
)
#unknow option
echo
"unkonw argument"
exit
1
;;
esac
done
echo
"enviMode=
${
enviMode
}
dnodeNumber=
${
dnodeNumber
}
dataRootDir=
${
dataRootDir
}
firstEp=
${
firstEp
}
startPort=
${
startPort
}
"
#curr_dir=$(pwd)
createNewCfgFile
()
{
cfgFile
=
$1
/taos.cfg
dataDir
=
$2
logDir
=
$3
firstEp
=
$4
serverPort
=
$5
echo
"debugFlag 131"
>
${
cfgFile
}
echo
"firstEp
${
firstEp
}
"
>>
${
cfgFile
}
echo
"dataDir
${
dataDir
}
"
>>
${
cfgFile
}
echo
"logDir
${
logDir
}
"
>>
${
cfgFile
}
echo
"serverPort
${
serverPort
}
"
>>
${
cfgFile
}
echo
"supportVnodes 1024"
>>
${
cfgFile
}
#echo "asyncLog 0" >> ${cfgFile}
echo
"telemetryReporting 0"
>>
${
cfgFile
}
}
createNewDnodesDataDir
()
{
if
[
-d
${
dataRootDir
}
]
;
then
rm
-rf
${
dataRootDir
}
/dnode
*
else
echo
"
${
dataRootDir
}
not exist"
exit
1
fi
dnodeNumber
=
$1
firstEp
=
$2
serverPort
=
${
startPort
}
for
((
i
=
0
;
i<
${
dnodeNumber
}
;
i++
))
;
do
mkdir
-p
${
dataRootDir
}
/dnode_
${
i
}
/cfg
mkdir
-p
${
dataRootDir
}
/dnode_
${
i
}
/log
mkdir
-p
${
dataRootDir
}
/dnode_
${
i
}
/data
createNewCfgFile
${
dataRootDir
}
/dnode_
${
i
}
/cfg
${
dataRootDir
}
/dnode_
${
i
}
/data
${
dataRootDir
}
/dnode_
${
i
}
/log
${
firstEp
}
${
serverPort
}
echo
"create dnode:
${
serverPort
}
,
${
dataRootDir
}
/dnode_
${
i
}
"
serverPort
=
$((
10
#${serverPort}+100))
done
}
function
kill_process
()
{
pid
=
$(
ps
-ef
|
grep
"
$1
"
|
grep
-v
"grep"
|
awk
'{print $2}'
)
if
[
-
n
"
$pid
"
]
;
then
kill
-
9
$pid
||
:
fi
}
startDnodes
()
{
dnodeNumber
=
$1
for
((
i
=
0
;
i<
${
dnodeNumber
}
;
i++
))
;
do
if
[
-d
${
dataRootDir
}
/dnode_
${
i
}
]
;
then
nohup
taosd
-c
${
dataRootDir
}
/dnode_
${
i
}
/cfg
>
/dev/null 2>&1 &
echo
"start taosd
${
dataRootDir
}
/dnode_
${
i
}
"
fi
done
}
########################################################################################
############################### main process ##########################################
## kill all taosd process
kill_process taosd
## create director for all dnode
if
[[
"
$enviMode
"
==
"new"
]]
;
then
createNewDnodesDataDir
${
dnodeNumber
}
${
firstEp
}
fi
## start all dnode by nohup
startDnodes
${
dnodeNumber
}
echo
" run setupDnodes.sh end !!!"
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录