Details
Description
When i test hdfs zkfc with wrong configurations , i can not start zkfc process, and did not find any errors in log except command errors as bellow
ERROR: Cannot set priority of zkfc process 59556
Debug zkfc and deep into the code, i find that zkfc exit because of HadoopIllegalArgumentException. I think we should catch this exception and log it.
Throwing HadoopIllegalArgumentException code is as follow
public static DFSZKFailoverController create(Configuration conf) { Configuration localNNConf = DFSHAAdmin.addSecurityConfiguration(conf); String nsId = DFSUtil.getNamenodeNameServiceId(conf); if (!HAUtil.isHAEnabled(localNNConf, nsId)) { throw new HadoopIllegalArgumentException( "HA is not enabled for this namenode."); } String nnId = HAUtil.getNameNodeId(localNNConf, nsId); if (nnId == null) { String msg = "Could not get the namenode ID of this node. " + "You may run zkfc on the node other than namenode."; throw new HadoopIllegalArgumentException(msg); } NameNode.initializeGenericKeys(localNNConf, nsId, nnId); DFSUtil.setGenericConf(localNNConf, nsId, nnId, ZKFC_CONF_KEYS); NNHAServiceTarget localTarget = new NNHAServiceTarget( localNNConf, nsId, nnId); return new DFSZKFailoverController(localNNConf, localTarget); }
In DFSZKFailoverController main function, we do not catch it and not log it
public static void main(String args[]) throws Exception { StringUtils.startupShutdownMessage(DFSZKFailoverController.class, args, LOG); if (DFSUtil.parseHelpArgument(args, ZKFailoverController.USAGE, System.out, true)) { System.exit(0); } GenericOptionsParser parser = new GenericOptionsParser( new HdfsConfiguration(), args); DFSZKFailoverController zkfc = DFSZKFailoverController.create( parser.getConfiguration()); try { System.exit(zkfc.run(parser.getRemainingArgs())); } catch (Throwable t) { LOG.error("DFSZKFailOverController exiting due to earlier exception " + t); terminate(1, t); } }