Explorar o código

HDFS-14207. ZKFC should catch exception when ha configuration missing. Contributed by Fei Hui.

(cherry picked from commit de34fc148ca4785c2ae7204df15096b955e671c4)
Weiwei Yang %!s(int64=6) %!d(string=hai) anos
pai
achega
2253a86a3f

+ 2 - 2
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DFSZKFailoverController.java

@@ -189,9 +189,9 @@ public class DFSZKFailoverController extends ZKFailoverController {
     
     GenericOptionsParser parser = new GenericOptionsParser(
         new HdfsConfiguration(), args);
-    DFSZKFailoverController zkfc = DFSZKFailoverController.create(
-        parser.getConfiguration());
     try {
+      DFSZKFailoverController zkfc = DFSZKFailoverController.create(
+          parser.getConfiguration());
       System.exit(zkfc.run(parser.getRemainingArgs()));
     } catch (Throwable t) {
       LOG.error("DFSZKFailOverController exiting due to earlier exception "