[ https://issues.apache.org/jira/browse/HDFS-12576?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16188881#comment-16188881 ]
Bharat Viswanadham edited comment on HDFS-12576 at 10/2/17 9:32 PM: -------------------------------------------------------------------- [~anu] What is happening currently is JOURNAL_NODES=$("${HADOOP_HDFS_HOME}/bin/hdfs" getconf -journalNodes 2>&-) this will get an empty string with a new line, when dfs.namenode.shared.edits.dir or dfs.namenode.shared.edits.dir.<<namespaceId>> is not set. *Example Output:* {code:java} hdfs@4abb0327cd7f:/$ /hadoop/bin/hdfs getconf -journalnodes 2017-10-02 21:30:46,563 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable hdfs@4abb0327cd7f:/$ {code} So, when nothing is set, the below check is passing , if [[ "{$JOURNAL_NODES-}" != $'\n' ]]; then So, to avoid that checked the lenght of the returned journal nodes. If length is greater than zero, there are journal nodes available, I need to start/stop otherwise nothing is set, no need to start/stop journal nodes. Pls let me know if it makes sense. was (Author: bharatviswa): [~anu] What is happening currently is JOURNAL_NODES=$("${HADOOP_HDFS_HOME}/bin/hdfs" getconf -journalNodes 2>&-) this will get an empty string with a new line, when dfs.namenode.shared.edits.dir or dfs.namenode.shared.edits.dir.<<namespaceId>> is not set. *Example Output:* {code:java} hdfs@4abb0327cd7f:/$ /hadoop/bin/hdfs getconf -journalnodes 2017-10-02 21:30:46,563 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable hdfs@4abb0327cd7f:/$ {code} So, when nothing is set, the below check is passing , if [[ "{$JOURNAL_NODES-}" != $'\n' ]]; then So, to avoid that checked the lenght of the returned journal nodes. If length is greater than zero, there are journal nodes available, I need to start/stop otherwise nothing is set, no need to start/stop journal nodes. > JournalNodes are getting started, even though dfs.namenode.shared.edits.dir > is not configured > --------------------------------------------------------------------------------------------- > > Key: HDFS-12576 > URL: https://issues.apache.org/jira/browse/HDFS-12576 > Project: Hadoop HDFS > Issue Type: Bug > Reporter: Bharat Viswanadham > Assignee: Bharat Viswanadham > Attachments: HDFS-12576.01.patch > > > dfs.namenode.shared.edits.dir is not configured, but still journal node is > getting started. -- This message was sent by Atlassian JIRA (v6.4.14#64029) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org