Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
2530f086
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
“e7f46e4a1ca81a0e090e83a0eda617a74705b6ab”上不存在“tests/pytest/query/queryCnameDisplay.py”
提交
2530f086
编写于
1月 24, 2022
作者:
P
plum-lihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[add docker scripts]
上级
9662ce95
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
469 addition
and
0 deletion
+469
-0
tests/script/sh/dockerbuilder/addDnodeToCluster.sh
tests/script/sh/dockerbuilder/addDnodeToCluster.sh
+36
-0
tests/script/sh/dockerbuilder/addFqdnToHost.sh
tests/script/sh/dockerbuilder/addFqdnToHost.sh
+46
-0
tests/script/sh/dockerbuilder/clientCfg/taos.cfg
tests/script/sh/dockerbuilder/clientCfg/taos.cfg
+4
-0
tests/script/sh/dockerbuilder/createComposeYml.sh
tests/script/sh/dockerbuilder/createComposeYml.sh
+136
-0
tests/script/sh/dockerbuilder/createDnodeStorage.sh
tests/script/sh/dockerbuilder/createDnodeStorage.sh
+90
-0
tests/script/sh/dockerbuilder/tdserver/Dockerfile
tests/script/sh/dockerbuilder/tdserver/Dockerfile
+42
-0
tests/script/sh/dockerbuilder/tmux.conf
tests/script/sh/dockerbuilder/tmux.conf
+115
-0
未找到文件。
tests/script/sh/dockerbuilder/addDnodeToCluster.sh
0 → 100755
浏览文件 @
2530f086
#!/bin/bash
#
# deploy test cluster
set
-e
#set -x
dnodeNumber
=
1
while
getopts
"hn:"
arg
do
case
$arg
in
n
)
dnodeNumber
=
$(
echo
$OPTARG
)
;;
h
)
echo
"Usage:
`
basename
$0
`
-n [ dnode number] "
exit
0
;;
?
)
#unknow option
echo
"unkonw argument"
exit
1
;;
esac
done
serverPort
=
6030
for
((
i
=
2
;
i<
=
${
dnodeNumber
}
;
i++
))
;
do
taos
-s
"create dnode node
${
i
}
port
${
serverPort
}
;"
||
:
echo
"create dnode node
${
i
}
port
${
serverPort
}
;"
done
tests/script/sh/dockerbuilder/addFqdnToHost.sh
0 → 100755
浏览文件 @
2530f086
#!/bin/bash
#
# deploy test cluster
set
-e
#set -x
dnodeNumber
=
1
subnet
=
"172.33.0.0/16"
while
getopts
"hn:s:"
arg
do
case
$arg
in
n
)
dnodeNumber
=
$(
echo
$OPTARG
)
;;
s
)
subnet
=
$(
echo
$OPTARG
)
;;
h
)
echo
"Usage:
`
basename
$0
`
-n [ dnode number] "
echo
" -s [ subnet] "
exit
0
;;
?
)
#unknow option
echo
"unkonw argument"
exit
1
;;
esac
done
addFqdnToHosts
()
{
index
=
$1
ipPrefix
=
$2
let
ipIndex
=
index+1
echo
"
${
ipPrefix
}
.
${
ipIndex
}
node
${
i
}
"
>>
/etc/hosts
}
ipPrefix
=
${
subnet
%.*
}
for
((
i
=
1
;
i<
=
${
dnodeNumber
}
;
i++
))
;
do
addFqdnToHosts
${
i
}
${
ipPrefix
}
done
tests/script/sh/dockerbuilder/clientCfg/taos.cfg
0 → 100644
浏览文件 @
2530f086
debugFlag 131
firstEp node1:6030
asyncLog 0
telemetryReporting 0
tests/script/sh/dockerbuilder/createComposeYml.sh
0 → 100755
浏览文件 @
2530f086
#!/bin/bash
#
# create docker-compose.yml
set
-e
#set -x
# set parameters by default value
composeYmlFile
=
"./docker-compose.yml"
dnodeNumber
=
1
subnet
=
"172.33.0.0/16"
while
getopts
"hn:f:s:"
arg
do
case
$arg
in
n
)
dnodeNumber
=
$(
echo
$OPTARG
)
;;
f
)
composeYmlFile
=
$(
echo
$OPTARG
)
;;
s
)
subnet
=
$(
echo
$OPTARG
)
;;
h
)
echo
"Usage:
`
basename
$0
`
-n [ dnode number] "
echo
" -f [ yml file] "
exit
0
;;
?
)
#unknow option
echo
"unkonw argument"
exit
1
;;
esac
done
echo
"dnodeNumber=
${
dnodeNumber
}
composeYmlFile=
${
composeYmlFile
}
"
createFirstSection
()
{
ymlFile
=
$1
echo
"version: '3.7'"
>
${
ymlFile
}
echo
""
>>
${
ymlFile
}
echo
"x-node: &x-node"
>>
${
ymlFile
}
echo
" build:"
>>
${
ymlFile
}
echo
" context: ."
>>
${
ymlFile
}
echo
" dockerfile: ./tdserver/Dockerfile"
>>
${
ymlFile
}
echo
" args:"
>>
${
ymlFile
}
echo
" - PACKAGE=TDengine-server-3.0.0.0-Linux-x64.tar.gz"
>>
${
ymlFile
}
echo
" - EXTRACTDIR=TDengine-server-3.0.0.0"
>>
${
ymlFile
}
echo
" image: 'tdengine:3.0.0.0'"
>>
${
ymlFile
}
echo
" container_name: 'node1'"
>>
${
ymlFile
}
echo
" privileged: true"
>>
${
ymlFile
}
echo
" cap_add:"
>>
${
ymlFile
}
echo
" - ALL"
>>
${
ymlFile
}
echo
" stdin_open: true"
>>
${
ymlFile
}
echo
" tty: true"
>>
${
ymlFile
}
echo
" environment:"
>>
${
ymlFile
}
echo
' TZ: "Asia/Shanghai"'
>>
${
ymlFile
}
echo
' command: >'
>>
${
ymlFile
}
echo
' sh -c "ln -snf /usr/share/zoneinfo/$TZ /etc/localtime &&'
>>
${
ymlFile
}
echo
' echo $TZ > /etc/timezone &&'
>>
${
ymlFile
}
echo
' exec sysctl -w kernel.core_pattern=/corefile/core-%e-%p"'
>>
${
ymlFile
}
echo
" restart: always"
>>
${
ymlFile
}
echo
" hostname: node1"
>>
${
ymlFile
}
echo
" command: taosd"
>>
${
ymlFile
}
echo
" deploy:"
>>
${
ymlFile
}
echo
" resources:"
>>
${
ymlFile
}
echo
" limits:"
>>
${
ymlFile
}
echo
' cpus: "2.00"'
>>
${
ymlFile
}
echo
" memory: 4G"
>>
${
ymlFile
}
echo
" reservations:"
>>
${
ymlFile
}
echo
' cpus: "1.00"'
>>
${
ymlFile
}
echo
" memory: 500M"
>>
${
ymlFile
}
echo
" volumes:"
>>
${
ymlFile
}
echo
" - /etc/localtime:/etc/localtime:ro"
>>
${
ymlFile
}
echo
' - $PWD:/work'
>>
${
ymlFile
}
echo
' - $PWD/storage/dnode1/data:/var/lib/taos'
>>
${
ymlFile
}
echo
' - $PWD/storage/dnode1/log:/var/log/taos'
>>
${
ymlFile
}
echo
' - $PWD/storage/dnode1/cfg:/etc/taos'
>>
${
ymlFile
}
echo
' - $PWD/storage/dnode1/core:/corefile'
>>
${
ymlFile
}
echo
""
>>
${
ymlFile
}
echo
"networks:"
>>
${
ymlFile
}
echo
" tdnet:"
>>
${
ymlFile
}
echo
" ipam:"
>>
${
ymlFile
}
echo
" driver: default"
>>
${
ymlFile
}
echo
" config:"
>>
${
ymlFile
}
echo
" - subnet:
${
subnet
}
"
>>
${
ymlFile
}
echo
""
>>
${
ymlFile
}
echo
"services:"
>>
${
ymlFile
}
}
createSingleDnodesCfg
()
{
ymlFile
=
$1
index
=
$2
ipPrefix
=
${
subnet
%.*
}
let
ipIndex
=
index+1
echo
" node
${
index
}
:"
>>
${
ymlFile
}
echo
" <<: *x-node"
>>
${
ymlFile
}
echo
" container_name: 'node
${
index
}
'"
>>
${
ymlFile
}
echo
" hostname: node
${
index
}
"
>>
${
ymlFile
}
echo
" networks:"
>>
${
ymlFile
}
echo
" tdnet:"
>>
${
ymlFile
}
echo
" ipv4_address:
${
ipPrefix
}
.
${
ipIndex
}
"
>>
${
ymlFile
}
echo
" volumes:"
>>
${
ymlFile
}
echo
" - /etc/localtime:/etc/localtime:ro"
>>
${
ymlFile
}
echo
" -
\$
PWD:/work"
>>
${
ymlFile
}
echo
" -
\$
PWD/storage/dnode
${
index
}
/data:/var/lib/taos"
>>
${
ymlFile
}
echo
" -
\$
PWD/storage/dnode
${
index
}
/log:/var/log/taos"
>>
${
ymlFile
}
echo
" -
\$
PWD/storage/dnode
${
index
}
/cfg:/etc/taos"
>>
${
ymlFile
}
echo
" -
\$
PWD/storage/dnode
${
index
}
/core:/corefile"
>>
${
ymlFile
}
echo
""
>>
${
ymlFile
}
}
createDnodesOfDockerComposeYml
()
{
ymlFile
=
$1
dnodeNumber
=
$2
for
((
i
=
1
;
i<
=
${
dnodeNumber
}
;
i++
))
;
do
createSingleDnodesCfg
${
ymlFile
}
${
i
}
done
}
########################################################################################
############################### main process ##########################################
createFirstSection
${
composeYmlFile
}
createDnodesOfDockerComposeYml
${
composeYmlFile
}
${
dnodeNumber
}
echo
"====create docker-compose.yml end===="
echo
" "
tests/script/sh/dockerbuilder/createDnodeStorage.sh
0 → 100755
浏览文件 @
2530f086
#!/bin/bash
#
# setup test environment
set
-e
#set -x
# set parameters by default value
dataRootDir
=
"/data/dockerbuilder/storage"
dnodeNumber
=
1
firstEp
=
"node1:6030"
while
getopts
"hn:r:f:"
arg
do
case
$arg
in
n
)
dnodeNumber
=
$(
echo
$OPTARG
)
;;
f
)
firstEp
=
$(
echo
$OPTARG
)
;;
r
)
dataRootDir
=
$(
echo
$OPTARG
)
;;
h
)
echo
"Usage:
`
basename
$0
`
-n [ dnode number] "
echo
" -n [ dnode number] "
echo
" -f [ first ep] "
echo
" -r [ data root dir] "
exit
0
;;
?
)
#unknow option
echo
"unkonw argument"
exit
1
;;
esac
done
echo
"dnodeNumber=
${
dnodeNumber
}
dataRootDir=
${
dataRootDir
}
firstEp=
${
firstEp
}
"
createTaosCfg
()
{
cfgFile
=
$1
/cfg/taos.cfg
#dataDir=$1/data
#logDir=$1/log
firstEp
=
$2
fqdn
=
$3
echo
"debugFlag 131"
>
${
cfgFile
}
echo
"firstEp
${
firstEp
}
"
>>
${
cfgFile
}
#echo "dataDir ${dataDir}" >> ${cfgFile}
#echo "logDir ${logDir}" >> ${cfgFile}
echo
"fqdn
${
fqdn
}
"
>>
${
cfgFile
}
echo
"supportVnodes 1024"
>>
${
cfgFile
}
echo
"asyncLog 0"
>>
${
cfgFile
}
echo
"telemetryReporting 0"
>>
${
cfgFile
}
}
createDnodesDataDir
()
{
if
[
-d
${
dataRootDir
}
]
;
then
rm
-rf
${
dataRootDir
}
/
*
else
echo
"
${
dataRootDir
}
not exist"
exit
1
fi
dnodeNumber
=
$1
firstEp
=
$2
serverPort
=
${
startPort
}
for
((
i
=
1
;
i<
=
${
dnodeNumber
}
;
i++
))
;
do
mkdir
-p
${
dataRootDir
}
/dnode
${
i
}
/cfg
mkdir
-p
${
dataRootDir
}
/dnode
${
i
}
/log
mkdir
-p
${
dataRootDir
}
/dnode
${
i
}
/data
mkdir
-p
${
dataRootDir
}
/dnode
${
i
}
/core
createTaosCfg
${
dataRootDir
}
/dnode
${
i
}
${
firstEp
}
node
${
i
}
done
}
########################################################################################
############################### main process ##########################################
## create director and taos.cfg for all dnode
createDnodesDataDir
${
dnodeNumber
}
${
firstEp
}
echo
"====create end===="
echo
" "
tests/script/sh/dockerbuilder/tdserver/Dockerfile
0 → 100644
浏览文件 @
2530f086
FROM
centos:8 AS builder
ARG
PACKAGE=TDengine-server-3.0.0.0-Linux-x64.tar.gz
ARG
EXTRACTDIR=TDengine-server-3.0.0.0
WORKDIR
/root
COPY
${PACKAGE} .
COPY
tmux.conf .
COPY
addDnodeToCluster.sh .
RUN
tar
-zxf
${
PACKAGE
}
RUN
mv
${
EXTRACTDIR
}
/
*
./
FROM
centos:8
WORKDIR
/root
RUN
yum
install
-y
glibc-langpack-en dmidecode gdb
RUN
yum
install
-y
tmux net-tools
RUN
yum
install
-y
sysstat
RUN
yum
install
-y
vim
RUN
echo
'alias ll="ls -l --color=auto"'
>>
~/.bashrc
COPY
--from=builder /root/taosd /usr/bin
COPY
--from=builder /root/taos /usr/bin
COPY
--from=builder /root/create_table /usr/bin
COPY
--from=builder /root/tmux.conf /root/.tmux.conf
#COPY --from=builder /root/addDnodeToCluster.sh /root/addDnodeToCluster.sh
#COPY --from=builder /root/cfg/taos.cfg /etc/taos/
COPY
--from=builder /root/lib/* /usr/lib/
ENV
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib"
ENV
LC_CTYPE=en_US.UTF-8
ENV
LANG=en_US.UTF-8
EXPOSE
6030-6042/tcp 6060/tcp 6030-6039/udp
# VOLUME [ "/var/lib/taos", "/var/log/taos", "/etc/taos" ]
CMD
[ "bash" ]
tests/script/sh/dockerbuilder/tmux.conf
0 → 100644
浏览文件 @
2530f086
unbind
C
-
b
# remap prefix to Control + z
set
-
g
prefix
C
-
a
# bind 'C-z C-z' to type 'C-z'
bind
C
-
a
send
-
prefix
# 0 is too far from ` ;)
set
-
g
base
-
index
1
# Automatically set window title
set
-
window
-
option
-
g
automatic
-
rename
on
set
-
option
-
g
set
-
titles
on
#set -g default-terminal screen-256color
set
-
g
status
-
keys
vi
set
-
g
history
-
limit
10000
setw
-
g
mode
-
keys
vi
#setw -g mode-mouse on
setw
-
g
monitor
-
activity
on
set
-
g
mouse
on
bind
-
key
v
split
-
window
-
h
-
c
"#{pane_current_path}"
bind
-
key
s
split
-
window
-
v
-
c
"#{pane_current_path}"
bind
-
key
c
new
-
window
-
c
"#{pane_current_path}"
bind
-
key
-
n
C
-
S
-
Left
swap
-
window
-
t
-
1
bind
-
key
-
n
C
-
S
-
Right
swap
-
window
-
t
+
1
# bind-key J resize-pane -D 5
# bind-key K resize-pane -U 5
# bind-key H resize-pane -L 5
# bind-key L resize-pane -R 5
# bind-key M-j resize-pane -D
# bind-key M-k resize-pane -U
# bind-key M-h resize-pane -L
# bind-key M-l resize-pane -R
# Vim style pane selection
bind
h
select
-
pane
-
L
bind
j
select
-
pane
-
D
bind
k
select
-
pane
-
U
bind
l
select
-
pane
-
R
bind
K
kill
-
pane
-
a
# Use Alt-vim keys without prefix key to switch panes
bind
-
n
M
-
h
select
-
pane
-
L
bind
-
n
M
-
j
select
-
pane
-
D
bind
-
n
M
-
k
select
-
pane
-
U
bind
-
n
M
-
l
select
-
pane
-
R
# bind -n M-h select-pane -L \; resize-pane -Z
# bind -n M-j select-pane -D \; resize-pane -Z
# bind -n M-k select-pane -U \; resize-pane -Z
# bind -n M-l select-pane -R \; resize-pane -Z
# # Use Alt-arrow keys without prefix key to switch panes
bind
-
n
M
-
Left
select
-
pane
-
L
bind
-
n
M
-
Right
select
-
pane
-
R
bind
-
n
M
-
Up
select
-
pane
-
U
bind
-
n
M
-
Down
select
-
pane
-
D
# Shift arrow to switch windows
bind
-
n
C
-
Left
previous
-
window
bind
-
n
C
-
Right
next
-
window
bind
-
n
M
-
n
previous
-
window
bind
-
n
M
-
p
nejt
-
window
# Map Alt-z to zoom in and out pane
bind
-
n
M
-
z
resize
-
pane
-
Z
bind
-
n
M
-
q
resize
-
pane
-
Z
# # Use v to trigger selection
bind
-
key
-
T
copy
-
mode
-
vi
v
send
-
keys
-
X
begin
-
selection
#
# # Use y to yank current selection
bind
-
key
-
T
copy
-
mode
-
vi
y
send
-
keys
-
X
copy
-
selection
-
and
-
cancel
# No delay for escape key press
set
-
sg
escape
-
time
0
# THEME
set
-
g
status
-
style
bg
=
black
,
fg
=
white
# set -g status-bg black
# set -g status-fg white
set
-
g
window
-
status
-
current
-
style
bg
=
green
,
fg
=
black
,
bold
set
-
g
pane
-
active
-
border
-
style
fg
=
green
,
bg
=
black
set
-
g
status
-
interval
60
set
-
g
status
-
left
-
length
30
set
-
g
status
-
left
'#[fg=green](#S) #(whoami)'
set
-
g
status
-
right
'#[fg=yellow]#(cut -d " " -f 1-3 /proc/loadavg)#[default] #[fg=white]%H:%M#[default]'
# synchronouse windows
# setw synchronize-panes
# pane movement
bind
-
key
b
command
-
prompt
-
p
"join pane from:"
"join-pane -s ':%%'"
bind
-
key
a
command
-
prompt
-
p
"send pane to:"
"join-pane -t ':%%'"
# # for vim
# # Smart pane switching with awareness of Vim splits.
# # See: https://github.com/christoomey/vim-tmux-navigator
# is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
# | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
# bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
# bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
# bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
# bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
# bind-key -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
# bind-key -T copy-mode-vi C-h select-pane -L
# bind-key -T copy-mode-vi C-j select-pane -D
# bind-key -T copy-mode-vi C-k select-pane -U
# bind-key -T copy-mode-vi C-l select-pane -R
# bind-key -T copy-mode-vi C-\ select-pane -l
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录