diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/start-dfs.sh b/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/start-dfs.sh index 12d5209a6a..dbdf41ece9 100755 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/start-dfs.sh +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/start-dfs.sh @@ -146,7 +146,7 @@ fi JOURNAL_NODES=$("${HADOOP_HDFS_HOME}/bin/hdfs" getconf -journalNodes 2>&-) -if [[ "{$JOURNAL_NODES-}" != $'\n' ]]; then +if [[ "${#JOURNAL_NODES}" != 0 ]]; then echo "Starting journal nodes [${JOURNAL_NODES}]" hadoop_uservar_su hdfs journalnode "${HADOOP_HDFS_HOME}/bin/hdfs" \ diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/stop-dfs.sh b/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/stop-dfs.sh index 92974ded73..3da146ec9a 100755 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/stop-dfs.sh +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/stop-dfs.sh @@ -102,7 +102,7 @@ fi JOURNAL_NODES=$("${HADOOP_HDFS_HOME}/bin/hdfs" getconf -journalNodes 2>&-) -if [[ "{$JOURNAL_NODES-}" != $'\n' ]]; then +if [[ "${#JOURNAL_NODES}" != 0 ]]; then echo "Stopping journal nodes [${JOURNAL_NODES}]" hadoop_uservar_su hdfs journalnode "${HADOOP_HDFS_HOME}/bin/hdfs" \