This is an automated email from the ASF dual-hosted git repository.
tanxinyu 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 46af90ca211 modify stop node scripts (#14047)
46af90ca211 is described below
commit 46af90ca2117580babc52cc45cda9bcd7c72b0d8
Author: shuwenwei <[email protected]>
AuthorDate: Mon Nov 11 14:01:07 2024 +0800
modify stop node scripts (#14047)
---
.../confignode/src/assembly/resources/sbin/stop-confignode.bat | 8 ++++----
.../confignode/src/assembly/resources/sbin/stop-confignode.sh | 5 +++++
iotdb-core/datanode/src/assembly/resources/sbin/stop-datanode.bat | 8 ++++----
iotdb-core/datanode/src/assembly/resources/sbin/stop-datanode.sh | 5 +++++
4 files changed, 18 insertions(+), 8 deletions(-)
diff --git
a/iotdb-core/confignode/src/assembly/resources/sbin/stop-confignode.bat
b/iotdb-core/confignode/src/assembly/resources/sbin/stop-confignode.bat
index 8c0e392f71b..b728e400fbc 100644
--- a/iotdb-core/confignode/src/assembly/resources/sbin/stop-confignode.bat
+++ b/iotdb-core/confignode/src/assembly/resources/sbin/stop-confignode.bat
@@ -39,8 +39,8 @@ for /f "eol=; tokens=2,2 delims==" %%i in ('findstr /i
"^cn_internal_port"
)
if not defined cn_internal_port (
- echo "cn_internal_port not found in the configuration file. Exiting."
- exit /b 1
+ echo "WARNING: cn_internal_port not found in the configuration file. Using
default value cn_internal_port = 10710"
+ set cn_internal_port=10710
)
echo "check whether the cn_internal_port is used..., port is
%cn_internal_port%"
@@ -51,8 +51,8 @@ for /f "eol=; tokens=2,2 delims==" %%i in ('findstr /i
"cn_internal_address"
)
if not defined cn_internal_address (
- echo "cn_internal_address not found in the configuration file. Exiting."
- exit /b 1
+ echo "WARNING: cn_internal_address not found in the configuration file.
Using default value cn_internal_address = 127.0.0.1"
+ set cn_internal_address=127.0.0.1
)
for /f "tokens=5" %%a in ('netstat /ano ^| findstr
%cn_internal_address%:%cn_internal_port% ^| findstr LISTENING ') do (
diff --git
a/iotdb-core/confignode/src/assembly/resources/sbin/stop-confignode.sh
b/iotdb-core/confignode/src/assembly/resources/sbin/stop-confignode.sh
index 5b2ccef01a5..f3207380dbd 100644
--- a/iotdb-core/confignode/src/assembly/resources/sbin/stop-confignode.sh
+++ b/iotdb-core/confignode/src/assembly/resources/sbin/stop-confignode.sh
@@ -27,6 +27,11 @@ else
cn_internal_port=$(sed '/^cn_internal_port=/!d;s/.*=//'
"${CONFIGNODE_CONF}"/iotdb-confignode.properties)
fi
+if [ -z "$cn_internal_port" ]; then
+ echo "WARNING: cn_internal_port not found in the configuration file. Using
default value cn_internal_port=10710"
+ cn_internal_port=10710
+fi
+
check_config_unique "cn_internal_port" "$cn_internal_port"
echo Check whether the internal_port is used..., port is "$cn_internal_port"
diff --git a/iotdb-core/datanode/src/assembly/resources/sbin/stop-datanode.bat
b/iotdb-core/datanode/src/assembly/resources/sbin/stop-datanode.bat
index fec69241234..251243e4c1e 100644
--- a/iotdb-core/datanode/src/assembly/resources/sbin/stop-datanode.bat
+++ b/iotdb-core/datanode/src/assembly/resources/sbin/stop-datanode.bat
@@ -44,8 +44,8 @@ for /f "eol=# tokens=2 delims==" %%i in ('findstr /i
"^dn_rpc_port"
)
if not defined dn_rpc_port (
- echo dn_rpc_port not found in the configuration file. Exiting.
- exit /b 1
+ echo "WARNING: dn_rpc_port not found in the configuration file. Using
default value dn_rpc_port = 6667"
+ set dn_rpc_port=6667
)
echo Check whether the rpc_port is used..., port is %dn_rpc_port%
@@ -56,8 +56,8 @@ for /f "eol=# tokens=2 delims==" %%i in ('findstr /i
"dn_rpc_address"
)
if not defined dn_rpc_address (
- echo dn_rpc_address not found in the configuration file. Exiting.
- exit /b 1
+ echo "WARNING: dn_rpc_address not found in the configuration file. Using
default value dn_rpc_address = 0.0.0.0"
+ set dn_rpc_address=0.0.0.0
)
for /f "tokens=5" %%a in ('netstat /ano ^| findstr
%dn_rpc_address%:%dn_rpc_port%') do (
diff --git a/iotdb-core/datanode/src/assembly/resources/sbin/stop-datanode.sh
b/iotdb-core/datanode/src/assembly/resources/sbin/stop-datanode.sh
index 94441cd6252..430367ec708 100644
--- a/iotdb-core/datanode/src/assembly/resources/sbin/stop-datanode.sh
+++ b/iotdb-core/datanode/src/assembly/resources/sbin/stop-datanode.sh
@@ -27,6 +27,11 @@ else
dn_rpc_port=`sed '/^dn_rpc_port=/!d;s/.*=//'
${DATANODE_CONF}/iotdb-datanode.properties`
fi
+if [ -z "$dn_rpc_port" ]; then
+ echo "WARNING: dn_rpc_port not found in the configuration file. Using
default value dn_rpc_port=6667"
+ dn_rpc_port=6667
+fi
+
check_config_unique "dn_rpc_port" "$dn_rpc_port"
force=""