[TD-2846]<test>: imporve docker cluster scripts
This commit is contained in:
parent
4e2e7596cb
commit
309bbd655e
|
@ -9,6 +9,7 @@ WORKDIR /root
|
|||
COPY ${PACKAGE} .
|
||||
|
||||
RUN tar -zxf ${PACKAGE}
|
||||
RUN tar -zxf ${TARBITRATORPKG}
|
||||
RUN mv ${EXTRACTDIR}/driver ./lib
|
||||
RUN tar -zxf ${EXTRACTDIR}/${CONTENT}
|
||||
|
||||
|
@ -19,8 +20,18 @@ WORKDIR /root
|
|||
RUN apt-get update
|
||||
RUN apt-get install -y vim tmux net-tools
|
||||
RUN echo 'alias ll="ls -l --color=auto"' >> /root/.bashrc
|
||||
RUN echo 'node1 172.27.0.7' >> /etc/hosts
|
||||
RUN echo 'node2 172.27.0.8' >> /etc/hosts
|
||||
RUN echo 'node3 172.27.0.9' >> /etc/hosts
|
||||
RUN echo 'node4 172.27.0.10' >> /etc/hosts
|
||||
RUN echo 'node5 172.27.0.11' >> /etc/hosts
|
||||
RUN ulimit -c unlimited
|
||||
RUN mkdir /coredump
|
||||
RUN echo 'kernel.core_pattern=/coredump/core_%e_%p' >> /etc/sysctl.conf
|
||||
RUN sysctl -p
|
||||
|
||||
COPY --from=builder /root/bin/taosd /usr/bin
|
||||
COPY --from=builder /root/bin/tarbitrator /usr/bin
|
||||
COPY --from=builder /root/bin/taos /usr/bin
|
||||
COPY --from=builder /root/cfg/taos.cfg /etc/taos/
|
||||
COPY --from=builder /root/lib/libtaos.so.* /usr/lib/libtaos.so.1
|
||||
|
@ -29,7 +40,7 @@ ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib"
|
|||
ENV LC_CTYPE=en_US.UTF-8
|
||||
ENV LANG=en_US.UTF-8
|
||||
|
||||
EXPOSE 6030-6041/tcp 6060/tcp 6030-6039/udp
|
||||
EXPOSE 6030-6042/tcp 6060/tcp 6030-6039/udp
|
||||
|
||||
# VOLUME [ "/var/lib/taos", "/var/log/taos", "/etc/taos" ]
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ function createDIR {
|
|||
mkdir -p /data/node$i/data
|
||||
mkdir -p /data/node$i/log
|
||||
mkdir -p /data/node$i/cfg
|
||||
mkdir -p /data/node$i/core
|
||||
done
|
||||
}
|
||||
|
||||
|
@ -54,16 +55,25 @@ function prepareBuild {
|
|||
rm -rf $CURR_DIR/../../../../release/*
|
||||
fi
|
||||
|
||||
|
||||
if [ ! -e $DOCKER_DIR/TDengine-server-$VERSION-Linux-x64.tar.gz && ! -e TDengine-arbitrator-$VERSION-Linux-x64.tar.gz ]; then
|
||||
cd $CURR_DIR/../../../../packaging
|
||||
./release.sh -v edge -n $VERSION >> /dev/null
|
||||
|
||||
if [ ! -f $CURR_DIR/../../../../release/TDengine-server-$VERSION-Linux-x64.tar.gz ]; then
|
||||
if [ ! -e $CURR_DIR/../../../../release/TDengine-server-$VERSION-Linux-x64.tar.gz ]; then
|
||||
echo "no TDengine install package found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -e $CURR_DIR/../../../../release/TDengine-arbitrator-$VERSION-Linux-x64.tar.gz ]; then
|
||||
echo "no arbitrator install package found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd $CURR_DIR/../../../../release
|
||||
mv TDengine-server-$VERSION-Linux-x64.tar.gz $DOCKER_DIR
|
||||
mv TDengine-arbitrator-$VERSION-Linux-x64.tar.gz $DOCKER_DIR
|
||||
fi
|
||||
|
||||
rm -rf $DOCKER_DIR/*.yml
|
||||
cd $CURR_DIR
|
||||
|
|
|
@ -6,9 +6,10 @@ services:
|
|||
context: .
|
||||
args:
|
||||
- PACKAGE=${PACKAGE}
|
||||
- TARBITRATORPKG=${TARBITRATORPKG}
|
||||
- EXTRACTDIR=${DIR}
|
||||
image: 'tdengine:${VERSION}'
|
||||
container_name: 'td2.0-node1'
|
||||
container_name: 'tdnode1'
|
||||
cap_add:
|
||||
- ALL
|
||||
stdin_open: true
|
||||
|
@ -32,14 +33,18 @@ services:
|
|||
- type: bind
|
||||
source: /data/node1/cfg
|
||||
target: /etc/taos
|
||||
# bind core dump path
|
||||
- type: bind
|
||||
source: /data/node2/core
|
||||
target: /coredump
|
||||
- type: bind
|
||||
source: /data
|
||||
target: /root
|
||||
hostname: node1
|
||||
hostname: tdnode1
|
||||
networks:
|
||||
taos_update_net:
|
||||
ipv4_address: 172.27.0.7
|
||||
command: taosd
|
||||
command: taosd && tarbitrator
|
||||
|
||||
td2.0-node2:
|
||||
build:
|
||||
|
@ -48,7 +53,7 @@ services:
|
|||
- PACKAGE=${PACKAGE}
|
||||
- EXTRACTDIR=${DIR}
|
||||
image: 'tdengine:${VERSION}'
|
||||
container_name: 'td2.0-node2'
|
||||
container_name: 'tdnode2'
|
||||
cap_add:
|
||||
- ALL
|
||||
stdin_open: true
|
||||
|
@ -72,9 +77,15 @@ services:
|
|||
- type: bind
|
||||
source: /data/node2/cfg
|
||||
target: /etc/taos
|
||||
# bind configuration
|
||||
- type: bind
|
||||
source: /data/node2/core
|
||||
target: /coredump
|
||||
# bind core dump path
|
||||
- type: bind
|
||||
source: /data
|
||||
target: /root
|
||||
hostname: tdnode2
|
||||
networks:
|
||||
taos_update_net:
|
||||
ipv4_address: 172.27.0.8
|
||||
|
@ -87,7 +98,7 @@ services:
|
|||
- PACKAGE=${PACKAGE}
|
||||
- EXTRACTDIR=${DIR}
|
||||
image: 'tdengine:${VERSION}'
|
||||
container_name: 'td2.0-node3'
|
||||
container_name: 'tdnode3'
|
||||
cap_add:
|
||||
- ALL
|
||||
stdin_open: true
|
||||
|
@ -111,9 +122,11 @@ services:
|
|||
- type: bind
|
||||
source: /data/node3/cfg
|
||||
target: /etc/taos
|
||||
# bind core dump path
|
||||
- type: bind
|
||||
source: /data
|
||||
target: /root
|
||||
hostname: tdnode3
|
||||
networks:
|
||||
taos_update_net:
|
||||
ipv4_address: 172.27.0.9
|
||||
|
|
|
@ -8,7 +8,7 @@ services:
|
|||
- PACKAGE=${PACKAGE}
|
||||
- EXTRACTDIR=${DIR}
|
||||
image: 'tdengine:2.0.13.1'
|
||||
container_name: 'td2.0-node4'
|
||||
container_name: 'tdnode4'
|
||||
cap_add:
|
||||
- ALL
|
||||
stdin_open: true
|
||||
|
@ -32,9 +32,14 @@ services:
|
|||
- type: bind
|
||||
source: /data/node4/cfg
|
||||
target: /etc/taos
|
||||
# bind core dump path
|
||||
- type: bind
|
||||
source: /data/node2/core
|
||||
target: /coredump
|
||||
- type: bind
|
||||
source: /data
|
||||
target: /root
|
||||
hostname: tdnode4
|
||||
networks:
|
||||
taos_update_net:
|
||||
ipv4_address: 172.27.0.10
|
||||
|
|
|
@ -8,7 +8,7 @@ services:
|
|||
- PACKAGE=${PACKAGE}
|
||||
- EXTRACTDIR=${DIR}
|
||||
image: 'tdengine:2.0.13.1'
|
||||
container_name: 'td2.0-node5'
|
||||
container_name: 'tdnode5'
|
||||
cap_add:
|
||||
- ALL
|
||||
stdin_open: true
|
||||
|
@ -32,9 +32,18 @@ services:
|
|||
- type: bind
|
||||
source: /data/node5/cfg
|
||||
target: /etc/taos
|
||||
# bind core dump path
|
||||
- type: bind
|
||||
source: /data/node2/core
|
||||
target: /coredump
|
||||
# bind core dump path
|
||||
- type: bind
|
||||
source: /data/node2/core
|
||||
target: /coredump
|
||||
- type: bind
|
||||
source: /data
|
||||
target: /root
|
||||
hostname: tdnode5
|
||||
networks:
|
||||
taos_update_net:
|
||||
ipv4_address: 172.27.0.11
|
||||
|
|
Loading…
Reference in New Issue