diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/server/JournalNode.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/server/JournalNode.java index 39a8034f1b2..5caccf764b1 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/server/JournalNode.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/server/JournalNode.java @@ -17,6 +17,8 @@ */ package org.apache.hadoop.hdfs.qjournal.server; +import static org.apache.hadoop.util.ExitUtil.terminate; + import java.io.File; import java.io.FileFilter; import java.io.IOException; @@ -307,7 +309,12 @@ public class JournalNode implements Tool, Configurable, JournalNodeMXBean { public static void main(String[] args) throws Exception { StringUtils.startupShutdownMessage(JournalNode.class, args, LOG); - System.exit(ToolRunner.run(new JournalNode(), args)); + try { + System.exit(ToolRunner.run(new JournalNode(), args)); + } catch (Throwable e) { + LOG.error("Failed to start journalnode.", e); + terminate(-1, e); + } } public void discardSegments(String journalId, long startTxId)