Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
3870a48f
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看板
提交
3870a48f
编写于
1月 21, 2022
作者:
haoranc
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '2.4' of github.com:taosdata/TDengine into release/ver-2.4.0.4
上级
586c7ae7
e327a14d
变更
5
展开全部
隐藏空白更改
内联
并排
Showing
5 changed file
with
844 addition
and
3 deletion
+844
-3
packaging/docker/Dockerfile
packaging/docker/Dockerfile
+7
-3
packaging/docker/README.md
packaging/docker/README.md
+664
-0
packaging/docker/bin/entrypoint.sh
packaging/docker/bin/entrypoint.sh
+83
-0
packaging/docker/bin/env-to-cfg
packaging/docker/bin/env-to-cfg
+13
-0
packaging/docker/docker-compose.yml
packaging/docker/docker-compose.yml
+77
-0
未找到文件。
packaging/docker/Dockerfile
浏览文件 @
3870a48f
...
@@ -11,12 +11,16 @@ RUN tar -zxf ${pkgFile}
...
@@ -11,12 +11,16 @@ RUN tar -zxf ${pkgFile}
WORKDIR
/root/${dirName}/
WORKDIR
/root/${dirName}/
RUN
/bin/bash install.sh
-e
no
RUN
/bin/bash install.sh
-e
no
RUN
apt-get clean
&&
apt-get update
&&
apt-get
install
-y
locales
&&
locale-gen en_US.UTF-8
ENV
DEBIAN_FRONTEND=noninteractive
RUN
apt-get clean
&&
apt-get update
&&
apt-get
install
-y
locales tzdata netcat
&&
locale-gen en_US.UTF-8
ENV
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib" \
ENV
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib" \
LC_CTYPE=en_US.UTF-8 \
LC_CTYPE=en_US.UTF-8 \
LANG=en_US.UTF-8 \
LANG=en_US.UTF-8 \
LC_ALL=en_US.UTF-8
LC_ALL=en_US.UTF-8
EXPOSE
6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042
EXPOSE
6030-6049
EXPOSE
6030-6039/udp
COPY
./bin/* /usr/bin/
ENTRYPOINT
["/usr/bin/entrypoint.sh"]
CMD
["taosd"]
CMD
["taosd"]
VOLUME
[ "/var/lib/taos", "/var/log/taos",
"/etc/taos/
" ]
VOLUME
[ "/var/lib/taos", "/var/log/taos",
"/corefile
" ]
packaging/docker/README.md
0 → 100644
浏览文件 @
3870a48f
此差异已折叠。
点击以展开。
packaging/docker/bin/entrypoint.sh
0 → 100755
浏览文件 @
3870a48f
#!/bin/sh
set
-e
# for TZ awareness
if
[
"
$TZ
"
!=
""
]
;
then
ln
-sf
/usr/share/zoneinfo/
$TZ
/etc/localtime
echo
$TZ
>
/etc/timezone
fi
# option to disable taosadapter, default is no
DISABLE_ADAPTER
=
${
TAOS_DISABLE_ADAPTER
:-
0
}
unset
TAOS_DISABLE_ADAPTER
# to get mnodeEpSet from data dir
DATA_DIR
=
${
TAOS_DATA_DIR
:-
/var/lib/taos
}
# append env to custom taos.cfg
CFG_DIR
=
/tmp/taos
CFG_FILE
=
$CFG_DIR
/taos.cfg
mkdir
-p
$CFG_DIR
>
/dev/null 2>&1
[
-f
/etc/taos/taos.cfg
]
&&
cat
/etc/taos/taos.cfg |
grep
-E
-v
"^#|^
\s
*$"
>
$CFG_FILE
env-to-cfg
>>
$CFG_FILE
FQDN
=
$(
cat
$CFG_FILE
|
grep
-E
-v
"^#|^$"
|
grep
fqdn |
tail
-n1
|
sed
-E
's/.*fqdn\s+//'
)
# ensure the fqdn is resolved as localhost
grep
"
$FQDN
"
/etc/hosts
>
/dev/null
||
echo
"127.0.0.1
$FQDN
"
>>
/etc/hosts
# parse first ep host and port
FIRST_EP_HOST
=
${
TAOS_FIRST_EP
%
:
*
}
FIRST_EP_PORT
=
${
TAOS_FIRST_EP
#*
:
}
# in case of custom server port
SERVER_PORT
=
$(
cat
$CFG_FILE
|
grep
-E
-v
"^#|^$"
|
grep
serverPort |
tail
-n1
|
sed
-E
's/.*serverPort\s+//'
)
SERVER_PORT
=
${
SERVER_PORT
:-
6030
}
# for other binaries like interpreters
if
echo
$1
|
grep
-E
"taosd$"
-
>
/dev/null
;
then
true
# will run taosd
else
cp
-f
$CFG_FILE
/etc/taos/taos.cfg
||
true
$@
exit
$?
fi
set
+e
ulimit
-c
unlimited
# set core files pattern, maybe failed
sysctl
-w
kernel.core_pattern
=
/corefile/core-
$FQDN
-%e-%p
>
/dev/null
>
&1
set
-e
if
[
"
$DISABLE_ADAPTER
"
=
"0"
]
;
then
which taosadapter
>
/dev/null
&&
taosadapter &
# wait for 6041 port ready
for
_
in
$(
seq
1 20
)
;
do
nc
-z
localhost 6041
&&
break
sleep
0.5
done
fi
# if has mnode ep set or the host is first ep or not for cluster, just start.
if
[
-f
"
$DATA_DIR
/dnode/mnodeEpSet.json"
]
||
[
"
$TAOS_FQDN
"
=
"
$FIRST_EP_HOST
"
]
;
then
$@
-c
$CFG_DIR
# others will first wait the first ep ready.
else
if
[
"
$TAOS_FIRST_EP
"
=
""
]
;
then
echo
"run TDengine with single node."
$@
-c
$CFG_DIR
exit
$?
fi
while
true
;
do
es
=
0
taos
-h
$FIRST_EP_HOST
-P
$FIRST_EP_PORT
-n
startup
>
/dev/null
||
es
=
$?
if
[
"
$es
"
-eq
0
]
;
then
taos
-h
$FIRST_EP_HOST
-P
$FIRST_EP_PORT
-s
"create dnode
\"
$FQDN
:
$SERVER_PORT
\"
;"
break
fi
sleep
1s
done
$@
-c
$CFG_DIR
fi
packaging/docker/bin/env-to-cfg
0 → 100755
浏览文件 @
3870a48f
#!/bin/sh
set
-e
self
=
$0
snake_to_camel_case
()
{
echo
$1
|
awk
-F
_
'{printf "%s", $1; for(i=2; i<=NF; i++) printf "%s", toupper(substr($i,1,1)) substr($i,2); print"";}'
}
if
echo
$1
|
grep
-E
"^$"
-
>
/dev/null
;
then
export
|grep
-E
'TAOS_.*'
-o
|
sed
's/TAOS_//'
|tr A-Z a-z |
awk
-F
"="
'{print "name=$(""'
$self
' " $1"); echo $name "$2}'
|sh
else
snake_to_camel_case
$1
fi
packaging/docker/docker-compose.yml
0 → 100644
浏览文件 @
3870a48f
version
:
"
3"
networks
:
inter
:
api
:
services
:
arbitrator
:
image
:
tdengine/tdengine:$VERSION
command
:
tarbitrator
networks
:
-
inter
td-1
:
image
:
tdengine/tdengine:$VERSION
networks
:
-
inter
environment
:
TAOS_FQDN
:
"
td-1"
TAOS_FIRST_EP
:
"
td-1"
TAOS_NUM_OF_MNODES
:
"
2"
TAOS_REPLICA
:
"
2"
TAOS_ARBITRATOR
:
arbitrator:6042
volumes
:
-
taosdata-td1:/var/lib/taos/
-
taoslog-td1:/var/log/taos/
td-2
:
image
:
tdengine/tdengine:$VERSION
networks
:
-
inter
environment
:
TAOS_FQDN
:
"
td-2"
TAOS_FIRST_EP
:
"
td-1"
TAOS_NUM_OF_MNODES
:
"
2"
TAOS_REPLICA
:
"
2"
TAOS_ARBITRATOR
:
arbitrator:6042
volumes
:
-
taosdata-td2:/var/lib/taos/
-
taoslog-td2:/var/log/taos/
adapter
:
image
:
tdengine/tdengine:$VERSION
command
:
taosadapter
networks
:
-
inter
environment
:
TAOS_FIRST_EP
:
"
td-1"
TOAS_SECOND_EP
:
"
td-2"
deploy
:
replicas
:
4
update_config
:
parallelism
:
4
nginx
:
image
:
nginx
depends_on
:
-
adapter
networks
:
-
inter
-
api
ports
:
-
6041:6041
-
6044:6044/udp
command
:
[
"
sh"
,
"
-c"
,
"
while
true;
do
curl
-s
http://adapter:6041/-/ping
>/dev/null
&&
break;
done;
printf
'server{listen
6041;location
/{proxy_pass
http://adapter:6041;}}'
>
/etc/nginx/conf.d/rest.conf;
printf
'stream{server{listen
6044
udp;proxy_pass
adapter:6044;}}'
>>
/etc/nginx/nginx.conf;cat
/etc/nginx/nginx.conf;
nginx
-g
'daemon
off;'"
,
]
volumes
:
taosdata-td1
:
taoslog-td1
:
taosdata-td2
:
taoslog-td2
:
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录