You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2023/07/25 06:30:39 UTC

[iotdb] 03/03: recever docker

This is an automated email from the ASF dual-hosted git repository.

haonan pushed a commit to branch test_0724_12
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 0dbb25fc35a9631c46cdbaa082f93a50b38ed5fc
Author: HTHou <hh...@outlook.com>
AuthorDate: Tue Jul 25 12:29:42 2023 +0800

    recever docker
---
 docker/src/main/DockerCompose/start-1c1d.sh | 12 +++++--
 docker/src/main/Dockerfile-1c1d             |  2 +-
 docker/src/main/Dockerfile-1c1d-influxdb    | 51 -----------------------------
 docker/src/main/Dockerfile-single           | 45 -------------------------
 docker/src/main/Dockerfile-single-influxdb  | 46 --------------------------
 docker/src/main/Dockerfile-single-tc        | 45 -------------------------
 6 files changed, 10 insertions(+), 191 deletions(-)

diff --git a/docker/src/main/DockerCompose/start-1c1d.sh b/docker/src/main/DockerCompose/start-1c1d.sh
index 6eaad325398..1c89dc91c5d 100755
--- a/docker/src/main/DockerCompose/start-1c1d.sh
+++ b/docker/src/main/DockerCompose/start-1c1d.sh
@@ -17,6 +17,12 @@
 # specific language governing permissions and limitations
 # under the License.
 #
-nohup /iotdb/sbin/start-confignode.sh > /dev/null 2>&1 &
-sleep 10
-/iotdb/sbin/start-datanode.sh
+function on_stop(){
+    bash /iotdb/sbin/stop-confignode.sh
+}
+
+trap 'on_stop' SIGTERM SIGKILL SIGQUIT SIGINT
+
+bash /iotdb/sbin/start-confignode.sh &
+sleep 5
+bash /iotdb/sbin/start-datanode.sh
diff --git a/docker/src/main/Dockerfile-1c1d b/docker/src/main/Dockerfile-1c1d
index 50201ca0b1a..e8c90aff873 100644
--- a/docker/src/main/Dockerfile-1c1d
+++ b/docker/src/main/Dockerfile-1c1d
@@ -30,7 +30,6 @@ RUN apt update \
   && rm /apache-iotdb-*-bin.zip \
   && mv /apache-iotdb-* /iotdb \
   && mv /start-1c1d.sh /iotdb/sbin \
-  && sed -i 's/dn_rpc_address=127.0.0.1/dn_rpc_address=0.0.0.0/g' /iotdb/conf/iotdb-datanode.properties \
   && sed -i 's/dn_internal_address=127.0.0.1/dn_internal_address=0.0.0.0/g' /iotdb/conf/iotdb-datanode.properties \
   && sed -i 's/cn_internal_address=127.0.0.1/cn_internal_address=0.0.0.0/g' /iotdb/conf/iotdb-confignode.properties \
   && sed -i 's/config_node_consensus_protocol_class=org.apache.iotdb.consensus.ratis.RatisConsensus/config_node_consensus_protocol_class=org.apache.iotdb.consensus.simple.SimpleConsensus/g' /iotdb/conf/iotdb-common.properties \
@@ -44,6 +43,7 @@ RUN dos2unix /iotdb/sbin/start-1c1d.sh
 RUN dos2unix /iotdb/sbin/iotdb-common.sh
 RUN dos2unix /iotdb/sbin/start-confignode.sh
 RUN dos2unix /iotdb/sbin/../conf/confignode-env.sh
+RUN dos2unix /iotdb/sbin/stop-confignode.sh
 RUN dos2unix /iotdb/sbin/start-datanode.sh
 RUN dos2unix /iotdb/sbin/../conf/datanode-env.sh
 EXPOSE 6667
diff --git a/docker/src/main/Dockerfile-1c1d-influxdb b/docker/src/main/Dockerfile-1c1d-influxdb
deleted file mode 100644
index 9877cfa3349..00000000000
--- a/docker/src/main/Dockerfile-1c1d-influxdb
+++ /dev/null
@@ -1,51 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-# docker build context is the root path of the repository
-
-FROM openjdk:11-jre-slim
-
-ADD distribution/target/apache-iotdb-*-all-bin.zip /
-ADD docker/src/main/DockerCompose/start-1c1d.sh /
-
-RUN apt update \
-  && apt install lsof dos2unix procps unzip -y \
-  && unzip /apache-iotdb-*-bin.zip -d / \
-  && rm /apache-iotdb-*-bin.zip \
-  && mv /apache-iotdb-* /iotdb \
-  && mv /start-1c1d.sh /iotdb/sbin \
-  && sed -i 's/# enable_influxdb_rpc_service=false/enable_influxdb_rpc_service=true/g' /iotdb/conf/iotdb-common.properties \
-  && sed -i 's/dn_rpc_address=127.0.0.1/dn_rpc_address=0.0.0.0/g' /iotdb/conf/iotdb-datanode.properties \
-  && sed -i 's/dn_internal_address=127.0.0.1/dn_internal_address=0.0.0.0/g' /iotdb/conf/iotdb-datanode.properties \
-  && sed -i 's/cn_internal_address=127.0.0.1/cn_internal_address=0.0.0.0/g' /iotdb/conf/iotdb-confignode.properties \
-  && apt remove unzip -y \
-  && apt autoremove -y \
-  && apt purge --auto-remove -y \
-  && apt clean -y
-RUN dos2unix /iotdb/sbin/start-1c1d.sh
-RUN dos2unix /iotdb/sbin/iotdb-common.sh
-RUN dos2unix /iotdb/sbin/start-confignode.sh
-RUN dos2unix /iotdb/sbin/../conf/confignode-env.sh
-RUN dos2unix /iotdb/sbin/start-datanode.sh
-RUN dos2unix /iotdb/sbin/../conf/datanode-env.sh
-EXPOSE 6667
-VOLUME /iotdb/data
-VOLUME /iotdb/logs
-ENV PATH="/iotdb/sbin/:/iotdb/tools/:${PATH}"
-ENTRYPOINT ["/iotdb/sbin/start-1c1d.sh"]
diff --git a/docker/src/main/Dockerfile-single b/docker/src/main/Dockerfile-single
deleted file mode 100644
index 3c1629cd864..00000000000
--- a/docker/src/main/Dockerfile-single
+++ /dev/null
@@ -1,45 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-# docker build context is the root path of the repository
-
-FROM openjdk:11-jre-slim
-
-ADD distribution/target/apache-iotdb-*-datanode-bin.zip /
-
-RUN apt update \
-  && apt install lsof dos2unix procps unzip -y \
-  && unzip /apache-iotdb-*-bin.zip -d / \
-  && rm /apache-iotdb-*-bin.zip \
-  && mv /apache-iotdb-* /iotdb \
-  && apt remove unzip -y \
-  && apt autoremove -y \
-  && apt purge --auto-remove -y \
-  && apt clean -y
-RUN dos2unix /iotdb/sbin/start-server.sh
-RUN dos2unix /iotdb/sbin/../conf/datanode-env.sh
-EXPOSE 6667
-EXPOSE 31999
-EXPOSE 5555
-EXPOSE 8086
-EXPOSE 8181
-VOLUME /iotdb/data
-VOLUME /iotdb/logs
-ENV PATH="/iotdb/sbin/:/iotdb/tools/:${PATH}"
-ENTRYPOINT ["/iotdb/sbin/start-server.sh"]
diff --git a/docker/src/main/Dockerfile-single-influxdb b/docker/src/main/Dockerfile-single-influxdb
deleted file mode 100644
index ff15b26cfbe..00000000000
--- a/docker/src/main/Dockerfile-single-influxdb
+++ /dev/null
@@ -1,46 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-# docker build context is the root path of the repository
-
-FROM openjdk:11-jre-slim
-
-ADD distribution/target/apache-iotdb-*-datanode-bin.zip /
-
-RUN apt update \
-  && apt install lsof dos2unix procps unzip -y \
-  && unzip /apache-iotdb-*-bin.zip -d / \
-  && rm /apache-iotdb-*-bin.zip \
-  && mv /apache-iotdb-* /iotdb \
-  && sed -i '/^# enable_influxdb_rpc_service=false/a enable_influxdb_rpc_service=true' /iotdb/sbin/../conf/iotdb-datanode.properties \
-  && apt remove unzip -y \
-  && apt autoremove -y \
-  && apt purge --auto-remove -y \
-  && apt clean -y
-RUN dos2unix /iotdb/sbin/start-new-server.sh
-RUN dos2unix /iotdb/sbin/../conf/datanode-env.sh
-EXPOSE 6667
-EXPOSE 31999
-EXPOSE 5555
-EXPOSE 8086
-EXPOSE 8181
-VOLUME /iotdb/data
-VOLUME /iotdb/logs
-ENV PATH="/iotdb/sbin/:/iotdb/tools/:${PATH}"
-ENTRYPOINT ["/iotdb/sbin/start-new-server.sh"]
diff --git a/docker/src/main/Dockerfile-single-tc b/docker/src/main/Dockerfile-single-tc
deleted file mode 100644
index d4dd297c744..00000000000
--- a/docker/src/main/Dockerfile-single-tc
+++ /dev/null
@@ -1,45 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-# docker build context is the root path of the repository
-
-FROM openjdk:11-jre-slim
-
-ADD distribution/target/apache-iotdb-*-datanode-bin.zip /
-
-RUN apt update \
-  && apt install lsof dos2unix procps unzip iproute2 iputils-ping -y \
-  && unzip /apache-iotdb-*-bin.zip -d / \
-  && rm /apache-iotdb-*-bin.zip \
-  && mv /apache-iotdb-* /iotdb \
-  && apt remove unzip -y \
-  && apt autoremove -y \
-  && apt purge --auto-remove -y \
-  && apt clean -y
-RUN dos2unix /iotdb/sbin/start-server.sh
-RUN dos2unix /iotdb/sbin/../conf/datanode-env.sh
-EXPOSE 6667
-EXPOSE 31999
-EXPOSE 5555
-EXPOSE 8086
-EXPOSE 8181
-VOLUME /iotdb/data
-VOLUME /iotdb/logs
-ENV PATH="/iotdb/sbin/:/iotdb/tools/:${PATH}"
-ENTRYPOINT ["/iotdb/sbin/start-server.sh"]
\ No newline at end of file