This is an automated email from the ASF dual-hosted git repository.
haonan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new baf37c3711d add --help with remove-xx script (#12585)
baf37c3711d is described below
commit baf37c3711d907ed15cc7a99f8d9b16e7c7eceea
Author: CritasWang <[email protected]>
AuthorDate: Tue May 28 10:34:30 2024 +0800
add --help with remove-xx script (#12585)
---
.../src/assembly/resources/sbin/remove-confignode.bat | 12 ++++++++++++
.../src/assembly/resources/sbin/remove-confignode.sh | 11 +++++++++++
.../datanode/src/assembly/resources/sbin/remove-datanode.bat | 12 ++++++++++++
.../datanode/src/assembly/resources/sbin/remove-datanode.sh | 11 +++++++++++
4 files changed, 46 insertions(+)
diff --git
a/iotdb-core/confignode/src/assembly/resources/sbin/remove-confignode.bat
b/iotdb-core/confignode/src/assembly/resources/sbin/remove-confignode.bat
index 145302cd11f..7db31371a45 100644
--- a/iotdb-core/confignode/src/assembly/resources/sbin/remove-confignode.bat
+++ b/iotdb-core/confignode/src/assembly/resources/sbin/remove-confignode.bat
@@ -18,6 +18,18 @@
@REM
@echo off
+
+IF "%~1"=="--help" (
+ echo The script will remove a ConfigNode.
+ echo Before removing a ConfigNode, ensure that there is at least one
active ConfigNode in the cluster after the removal.
+ echo Usage:
+ echo Remove the ConfigNode with confignode_id
+ echo ./sbin/remove-confignode.sh [confignode_id]
+ echo Remove the ConfigNode with address:port
+ echo ./sbin/remove-confignode.sh [cn_internal_address:cn_internal_port]
+ EXIT /B 0
+)
+
echo ```````````````````````````
echo Starting to remove IoTDB ConfigNode
echo ```````````````````````````
diff --git
a/iotdb-core/confignode/src/assembly/resources/sbin/remove-confignode.sh
b/iotdb-core/confignode/src/assembly/resources/sbin/remove-confignode.sh
index dae57fe1611..defa7a8eba0 100755
--- a/iotdb-core/confignode/src/assembly/resources/sbin/remove-confignode.sh
+++ b/iotdb-core/confignode/src/assembly/resources/sbin/remove-confignode.sh
@@ -18,6 +18,17 @@
# under the License.
#
+if [ "$#" -eq 1 ] && [ "$1" == "--help" ]; then
+ echo "The script will remove a ConfigNode."
+ echo "Before removing a ConfigNode, ensure that there is at least one
active ConfigNode in the cluster after the removal."
+ echo "Usage:"
+ echo "Remove the ConfigNode with confignode_id"
+ echo "./sbin/remove-confignode.sh [confignode_id]"
+ echo "Remove the ConfigNode with address:port"
+ echo "./sbin/remove-confignode.sh [cn_internal_address:cn_internal_port]"
+ exit 0
+fi
+
echo ----------------------------
echo Starting to remove IoTDB ConfigNode
echo ----------------------------
diff --git
a/iotdb-core/datanode/src/assembly/resources/sbin/remove-datanode.bat
b/iotdb-core/datanode/src/assembly/resources/sbin/remove-datanode.bat
index 0873026d11f..8546332c0cb 100644
--- a/iotdb-core/datanode/src/assembly/resources/sbin/remove-datanode.bat
+++ b/iotdb-core/datanode/src/assembly/resources/sbin/remove-datanode.bat
@@ -18,6 +18,18 @@
@REM
@echo off
+
+IF "%~1"=="--help" (
+ echo The script will remove a DataNode.
+ echo Before removing a DataNode, ensure that the cluster has at least the
number of data/schema replicas DataNodes.
+ echo Usage:
+ echo Remove the DataNode with datanode_id
+ echo ./sbin/remove-datanode.sh [datanode_id]
+ echo Remove the DataNode with address:port
+ echo ./sbin/remove-confignode.sh [dn_rpc_address:dn_rpc_port]
+ EXIT /B 0
+)
+
echo ````````````````````````
echo Starting to remove a DataNode
echo ````````````````````````
diff --git a/iotdb-core/datanode/src/assembly/resources/sbin/remove-datanode.sh
b/iotdb-core/datanode/src/assembly/resources/sbin/remove-datanode.sh
old mode 100644
new mode 100755
index ada9089aa42..51a70b13819
--- a/iotdb-core/datanode/src/assembly/resources/sbin/remove-datanode.sh
+++ b/iotdb-core/datanode/src/assembly/resources/sbin/remove-datanode.sh
@@ -18,6 +18,17 @@
# under the License.
#
+if [ "$#" -eq 1 ] && [ "$1" == "--help" ]; then
+ echo "The script will remove a DataNode."
+ echo "Before removing a DataNode, ensure that the cluster has at least the
number of data/schema replicas DataNodes."
+ echo "Usage:"
+ echo "Remove the DataNode with datanode_id"
+ echo "./sbin/remove-datanode.sh [datanode_id]"
+ echo "Remove the DataNode with address:port"
+ echo "./sbin/remove-confignode.sh [dn_rpc_address:dn_rpc_port]"
+ exit 0
+fi
+
echo ---------------------
echo "Starting to remove a DataNode"
echo ---------------------