Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
8c8f3d08
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
8c8f3d08
编写于
3月 22, 2021
作者:
L
liuyq-617
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-3406]<test>support more dnodes in docker clu
上级
d546f74a
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
64 addition
and
22 deletion
+64
-22
tests/pytest/cluster/clusterEnvSetup/basic.py
tests/pytest/cluster/clusterEnvSetup/basic.py
+2
-2
tests/pytest/cluster/clusterEnvSetup/buildClusterEnv.sh
tests/pytest/cluster/clusterEnvSetup/buildClusterEnv.sh
+40
-18
tests/pytest/cluster/clusterEnvSetup/cleanClusterEnv.sh
tests/pytest/cluster/clusterEnvSetup/cleanClusterEnv.sh
+1
-1
tests/pytest/cluster/clusterEnvSetup/docker-compose.yml
tests/pytest/cluster/clusterEnvSetup/docker-compose.yml
+5
-0
tests/pytest/cluster/clusterEnvSetup/node3.yml
tests/pytest/cluster/clusterEnvSetup/node3.yml
+6
-1
tests/pytest/cluster/clusterEnvSetup/node4.yml
tests/pytest/cluster/clusterEnvSetup/node4.yml
+5
-0
tests/pytest/cluster/clusterEnvSetup/node5.yml
tests/pytest/cluster/clusterEnvSetup/node5.yml
+5
-0
未找到文件。
tests/pytest/cluster/clusterEnvSetup/basic.py
浏览文件 @
8c8f3d08
...
...
@@ -45,8 +45,8 @@ class BuildDockerCluser:
os
.
system
(
"docker exec -d $(docker ps|grep tdnode1|awk '{print $1}') tarbitrator"
)
def
run
(
self
):
if
self
.
numOfNodes
<
2
or
self
.
numOfNodes
>
5
:
print
(
"the number of nodes must be between 2 and
5
"
)
if
self
.
numOfNodes
<
2
or
self
.
numOfNodes
>
10
:
print
(
"the number of nodes must be between 2 and
10
"
)
exit
(
0
)
print
(
"remove Flag value %s"
%
self
.
removeFlag
)
if
self
.
removeFlag
==
False
:
...
...
tests/pytest/cluster/clusterEnvSetup/buildClusterEnv.sh
浏览文件 @
8c8f3d08
...
...
@@ -32,7 +32,7 @@ do
done
function
addTaoscfg
{
for
i
in
{
1..5
}
for
((
i
=
1
;
i<
=
$NUM_OF_NODES
;
i++
))
do
touch
$DOCKER_DIR
/node
$i
/cfg/taos.cfg
echo
'firstEp tdnode1:6030'
>
$DOCKER_DIR
/node
$i
/cfg/taos.cfg
...
...
@@ -42,7 +42,7 @@ function addTaoscfg {
}
function
createDIR
{
for
i
in
{
1..5
}
for
((
i
=
1
;
i<
=
$NUM_OF_NODES
;
i++
))
do
mkdir
-p
$DOCKER_DIR
/node
$i
/data
mkdir
-p
$DOCKER_DIR
/node
$i
/log
...
...
@@ -53,7 +53,7 @@ function createDIR {
function
cleanEnv
{
echo
"Clean up docker environment"
for
i
in
{
1..5
}
for
((
i
=
1
;
i<
=
$NUM_OF_NODES
;
i++
))
do
rm
-rf
$DOCKER_DIR
/node
$i
/data/
*
rm
-rf
$DOCKER_DIR
/node
$i
/log/
*
...
...
@@ -99,22 +99,44 @@ function clusterUp {
cd
$DOCKER_DIR
if
[
$NUM_OF_NODES
-eq
2
]
;
then
echo
"create 2 dnodes"
PACKAGE
=
TDengine-server-
$VERSION
-Linux-x64
.tar.gz
TARBITRATORPKG
=
TDengine-arbitrator-
$VERSION
-Linux-x64
.tar.gz
DIR
=
TDengine-server-
$VERSION
DIR2
=
TDengine-arbitrator-
$VERSION
VERSION
=
$VERSION
DATADIR
=
$DOCKER_DIR
docker-compose up
-d
fi
if
[
$NUM_OF_NODES
-eq
3
]
;
then
PACKAGE
=
TDengine-server-
$VERSION
-Linux-x64
.tar.gz
TARBITRATORPKG
=
TDengine-arbitrator-
$VERSION
-Linux-x64
.tar.gz
DIR
=
TDengine-server-
$VERSION
DIR2
=
TDengine-arbitrator-
$VERSION
VERSION
=
$VERSION
DATADIR
=
$DOCKER_DIR
docker-compose
-f
docker-compose.yml
-f
node3.yml up
-d
fi
if
[
$NUM_OF_NODES
-eq
4
]
;
then
PACKAGE
=
TDengine-server-
$VERSION
-Linux-x64
.tar.gz
TARBITRATORPKG
=
TDengine-arbitrator-
$VERSION
-Linux-x64
.tar.gz
DIR
=
TDengine-server-
$VERSION
DIR2
=
TDengine-arbitrator-
$VERSION
VERSION
=
$VERSION
DATADIR
=
$DOCKER_DIR
docker-compose
-f
docker-compose.yml
-f
node3.yml
-f
node4.yml up
-d
fi
if
[
$NUM_OF_NODES
-eq
5
]
;
then
PACKAGE
=
TDengine-server-
$VERSION
-Linux-x64
.tar.gz
TARBITRATORPKG
=
TDengine-arbitrator-
$VERSION
-Linux-x64
.tar.gz
DIR
=
TDengine-server-
$VERSION
DIR2
=
TDengine-arbitrator-
$VERSION
VERSION
=
$VERSION
DATADIR
=
$DOCKER_DIR
docker-compose
-f
docker-compose.yml
-f
node3.yml
-f
node4.yml
-f
node5.yml up
-d
# if [ $NUM_OF_NODES -eq 2 ]; then
# echo "create 2 dnodes"
# PACKAGE=TDengine-server-$VERSION-Linux-x64.tar.gz TARBITRATORPKG=TDengine-arbitrator-$VERSION-Linux-x64.tar.gz DIR=TDengine-server-$VERSION DIR2=TDengine-arbitrator-$VERSION VERSION=$VERSION DATADIR=$DOCKER_DIR docker-compose up -d
# fi
docker_run
=
"PACKAGE=TDengine-server-
$VERSION
-Linux-x64.tar.gz TARBITRATORPKG=TDengine-arbitrator-
$VERSION
-Linux-x64.tar.gz DIR=TDengine-server-
$VERSION
DIR2=TDengine-arbitrator-
$VERSION
VERSION=
$VERSION
DATADIR=
$DOCKER_DIR
docker-compose -f docker-compose.yml "
if
[
$NUM_OF_NODES
-ge
2
]
;
then
echo
"create
$NUM_OF_NODES
dnodes"
for
((
i
=
3
;
i<
=
$NUM_OF_NODES
;
i++
))
do
if
[
!
-f
node
$i
.yml
]
;
then
echo
"node
$i
.yml not exist"
# cp $CURR_DIR/node3.yml $CURR_DIR/node$i.yml
# sed -i "s/td2.0-node3/td2.0-node$i/g" $CURR_DIR/node$i.yml
# sed -i "s/'tdnode3'/'tdnode$i'/g" $CURR_DIR/node$i.yml
# sed -i "s#/node3/#/node$i/#g" $CURR_DIR/node$i.yml
# sed -i "s#ipv4_address: 172.27.0.9#ipv4_address: 172.27.0.`expr $i + 6`#g" $CURR_DIR/node$i.yml
cp
node3.yml node
$i
.yml
sed
-i
"s/td2.0-node3/td2.0-node
$i
/g"
node
$i
.yml
sed
-i
"s/'tdnode3'/'tdnode
$i
'/g"
node
$i
.yml
sed
-i
"s#/node3/#/node
$i
/#g"
node
$i
.yml
sed
-i
"s#ipv4_address: 172.27.0.9#ipv4_address: 172.27.0.
`
expr
$i
+ 6
`
#g"
node
$i
.yml
fi
docker_run
=
$docker_run
" -f node
$i
.yml "
done
docker_run
=
$docker_run
" up -d"
fi
echo
$docker_run
|sh
# if [ $NUM_OF_NODES -eq 3 ]; then
# PACKAGE=TDengine-server-$VERSION-Linux-x64.tar.gz TARBITRATORPKG=TDengine-arbitrator-$VERSION-Linux-x64.tar.gz DIR=TDengine-server-$VERSION DIR2=TDengine-arbitrator-$VERSION VERSION=$VERSION DATADIR=$DOCKER_DIR docker-compose -f docker-compose.yml -f node3.yml up -d
# fi
# if [ $NUM_OF_NODES -eq 4 ]; then
# PACKAGE=TDengine-server-$VERSION-Linux-x64.tar.gz TARBITRATORPKG=TDengine-arbitrator-$VERSION-Linux-x64.tar.gz DIR=TDengine-server-$VERSION DIR2=TDengine-arbitrator-$VERSION VERSION=$VERSION DATADIR=$DOCKER_DIR docker-compose -f docker-compose.yml -f node3.yml -f node4.yml up -d
# fi
# if [ $NUM_OF_NODES -eq 5 ]; then
# PACKAGE=TDengine-server-$VERSION-Linux-x64.tar.gz TARBITRATORPKG=TDengine-arbitrator-$VERSION-Linux-x64.tar.gz DIR=TDengine-server-$VERSION DIR2=TDengine-arbitrator-$VERSION VERSION=$VERSION DATADIR=$DOCKER_DIR docker-compose -f docker-compose.yml -f node3.yml -f node4.yml -f node5.yml up -d
# fi
echo
"docker compose finish"
}
...
...
tests/pytest/cluster/clusterEnvSetup/cleanClusterEnv.sh
浏览文件 @
8c8f3d08
...
...
@@ -28,7 +28,7 @@ function removeDockerContainers {
function
cleanEnv
{
echo
"Clean up docker environment"
for
i
in
{
1..
5
}
for
i
in
{
1..
10
}
do
rm
-rf
$DOCKER_DIR
/node
$i
/data/
*
rm
-rf
$DOCKER_DIR
/node
$i
/log/
*
...
...
tests/pytest/cluster/clusterEnvSetup/docker-compose.yml
浏览文件 @
8c8f3d08
...
...
@@ -30,6 +30,11 @@ services:
-
"
tdnode3:172.27.0.9"
-
"
tdnode4:172.27.0.10"
-
"
tdnode5:172.27.0.11"
-
"
tdnode6:172.27.0.12"
-
"
tdnode7:172.27.0.13"
-
"
tdnode8:172.27.0.14"
-
"
tdnode9:172.27.0.15"
-
"
tdnode9:172.27.0.16"
volumes
:
# bind data directory
-
type
:
bind
...
...
tests/pytest/cluster/clusterEnvSetup/node3.yml
浏览文件 @
8c8f3d08
...
...
@@ -24,10 +24,15 @@ services:
sysctl -p &&
exec my-main-application"
extra_hosts
:
-
"
tdnode1:172.27.0.7"
-
"
tdnode2:172.27.0.8"
-
"
tdnode3:172.27.0.9"
-
"
tdnode4:172.27.0.10"
-
"
tdnode5:172.27.0.11"
-
"
tdnode6:172.27.0.12"
-
"
tdnode7:172.27.0.13"
-
"
tdnode8:172.27.0.14"
-
"
tdnode9:172.27.0.15"
-
"
tdnode9:172.27.0.16"
volumes
:
# bind data directory
-
type
:
bind
...
...
tests/pytest/cluster/clusterEnvSetup/node4.yml
浏览文件 @
8c8f3d08
...
...
@@ -28,6 +28,11 @@ services:
-
"
tdnode3:172.27.0.9"
-
"
tdnode4:172.27.0.10"
-
"
tdnode5:172.27.0.11"
-
"
tdnode6:172.27.0.12"
-
"
tdnode7:172.27.0.13"
-
"
tdnode8:172.27.0.14"
-
"
tdnode9:172.27.0.15"
-
"
tdnode9:172.27.0.16"
volumes
:
# bind data directory
-
type
:
bind
...
...
tests/pytest/cluster/clusterEnvSetup/node5.yml
浏览文件 @
8c8f3d08
...
...
@@ -28,6 +28,11 @@ services:
-
"
tdnode3:172.27.0.9"
-
"
tdnode4:172.27.0.10"
-
"
tdnode5:172.27.0.11"
-
"
tdnode6:172.27.0.12"
-
"
tdnode7:172.27.0.13"
-
"
tdnode8:172.27.0.14"
-
"
tdnode9:172.27.0.15"
-
"
tdnode9:172.27.0.16"
volumes
:
# bind data directory
-
type
:
bind
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录