neuyilan commented on a change in pull request #1634:
URL: https://github.com/apache/incubator-iotdb/pull/1634#discussion_r472651213



##########
File path: cluster/src/main/java/org/apache/iotdb/cluster/ClusterMain.java
##########
@@ -211,6 +211,10 @@ private static void doRemoveNode(String[] args) throws 
IOException {
     String ip = args[1];
     int metaPort = Integer.parseInt(args[2]);
     ClusterConfig config = ClusterDescriptor.getInstance().getConfig();
+    if(config.getReplicationNum()==1||config.getReplicationNum()==2) {
+      logger.error("When default_ replica_ When num = 1 or 2, the node cannot 
be removed temporarily, because in the current implementation, datagroup cannot 
achieve majority agreement");

Review comment:
       “default_ replica_ When“ what this mean?

##########
File path: cluster/src/assembly/resources/sbin/remove-node.sh
##########
@@ -0,0 +1,75 @@
+#!/bin/bash
+#
+# 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.
+#
+
+sh stop-node.sh
+
+if [ -z "${IOTDB_HOME}" ]; then
+  export IOTDB_HOME="`dirname "$0"`/.."
+fi
+
+IOTDB_CONF=${IOTDB_HOME}/conf
+# IOTDB_LOGS=${IOTDB_HOME}/logs
+
+if [ -f "$IOTDB_CONF/cluster-env.sh" ]; then
+    . "$IOTDB_CONF/cluster-env.sh"
+else
+    echo "can't find $IOTDB_CONF/cluster-env.sh"
+fi
+
+if [ -n "$JAVA_HOME" ]; then
+    for java in "$JAVA_HOME"/bin/amd64/java "$JAVA_HOME"/bin/java; do
+        if [ -x "$java" ]; then
+            JAVA="$java"
+            break
+        fi
+    done
+else
+    JAVA=java
+fi
+
+if [ -z $JAVA ] ; then
+    echo Unable to find java executable. Check JAVA_HOME and PATH environment 
variables.  > /dev/stderr
+    exit 1;
+fi
+
+CLASSPATH=""
+for f in ${IOTDB_HOME}/lib/*.jar; do
+  CLASSPATH=${CLASSPATH}":"$f
+done
+classname=org.apache.iotdb.cluster.ClusterMain
+
+launch_service()
+{
+       class="$1"
+       iotdb_parms="-Dlogback.configurationFile=${IOTDB_CONF}/logback.xml"
+       iotdb_parms="$iotdb_parms -DIOTDB_HOME=${IOTDB_HOME}"
+       iotdb_parms="$iotdb_parms -DTSFILE_HOME=${IOTDB_HOME}"
+       iotdb_parms="$iotdb_parms -DIOTDB_CONF=${IOTDB_CONF}"
+       iotdb_parms="$iotdb_parms -Dname=iotdb\.IoTDB"
+       ip=`sed '/^cluster_rpc_ip=/!d;s/.*=//' 
$IOTDB_CONF/iotdb-cluster.properties`
+  meta_port=`sed '/^internal_meta_port=/!d;s/.*=//' 
$IOTDB_CONF/iotdb-cluster.properties`

Review comment:
       code format




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to