{"record":{"id":"d15a07c0906f7e90","repo":"apache/hadoop","slug":"ha-is-not-enabled-for-this-namenode","errorCode":null,"errorMessage":"HA is not enabled for this namenode.","messagePattern":"HA is not enabled for this namenode\\.","errorType":"validation","errorClass":"HadoopIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ha/BootstrapStandby.java","lineNumber":461,"sourceCode":"    }\n  }\n\n  private boolean checkLayoutVersion(NamespaceInfo nsInfo, boolean isRollingUpgrade) {\n    if (isRollingUpgrade) {\n      // During a rolling upgrade the service layout versions may be different,\n      // but we should check that the layout version being sent is compatible\n      return nsInfo.getLayoutVersion() <=\n          HdfsServerConstants.MINIMUM_COMPATIBLE_NAMENODE_LAYOUT_VERSION;\n    }\n    return nsInfo.getLayoutVersion() == nsInfo.getServiceLayoutVersion();\n  }\n\n  private void parseConfAndFindOtherNN() throws IOException {\n    Configuration conf = getConf();\n    nsId = DFSUtil.getNamenodeNameServiceId(conf);\n\n    if (!HAUtil.isHAEnabled(conf, nsId)) {\n      throw new HadoopIllegalArgumentException(\n          \"HA is not enabled for this namenode.\");\n    }\n    nnId = HAUtil.getNameNodeId(conf, nsId);\n    NameNode.initializeGenericKeys(conf, nsId, nnId);\n\n    if (!HAUtil.usesSharedEditsDir(conf)) {\n      throw new HadoopIllegalArgumentException(\n        \"Shared edits storage is not enabled for this namenode.\");\n    }\n\n\n    remoteNNs = RemoteNameNodeInfo.getRemoteNameNodes(conf, nsId);\n    // validate the configured NNs\n    List<RemoteNameNodeInfo> remove = new ArrayList<RemoteNameNodeInfo>(remoteNNs.size());\n    for (RemoteNameNodeInfo info : remoteNNs) {\n      InetSocketAddress address = info.getIpcAddress();\n      LOG.info(\"Found nn: \" + info.getNameNodeID() + \", ipc: \" + info.getIpcAddress());\n      if (address.getPort() == 0 || address.getAddress().isAnyLocalAddress()) {","sourceCodeStart":443,"sourceCodeEnd":479,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ha/BootstrapStandby.java#L443-L479","documentation":"BootstrapStandby.parseConfAndFindOtherNN() refuses to run when HAUtil.isHAEnabled(conf, nsId) is false — the node's configuration does not define an HA nameservice (no dfs.ha.namenodes.<nameservice> listing multiple NameNodes). '-bootstrapStandby' only makes sense for HA, so it aborts with HadoopIllegalArgumentException.","triggerScenarios":"Running 'hdfs namenode -bootstrapStandby' on a node whose hdfs-site.xml has no HA nameservice configuration for its nameservice id (missing dfs.nameservices / dfs.ha.namenodes.<nsId> entries), or the wrong (default) config file is picked up so nsId resolves to nothing.","commonSituations":"Fresh standby node provisioned from a non-HA template; configuration staged to the wrong directory so the NN starts with an old hdfs-site.xml; nameservice id mismatch between dfs.nameservices and dfs.ha.namenodes keys after a rename.","solutions":["Add full HA config on this node: dfs.nameservices, dfs.ha.namenodes.<nsId> with both NN ids, and per-NN rpc/http address keys","Verify the right config files load (hdfs getconf -nameservices; check HADOOP_CONF_DIR) and that the nsId matches the keys","Re-run 'hdfs namenode -bootstrapStandby' once HA config is in place"],"exampleFix":"<!-- before: no HA keys -->\n<property><name>dfs.namenode.http-address</name><value>nn1:9870</value></property>\n<!-- after -->\n<property><name>dfs.nameservices</name><value>ns1</value></property>\n<property><name>dfs.ha.namenodes.ns1</name><value>nn1,nn2</value></property>\n<property><name>dfs.namenode.rpc-address.ns1.nn1</name><value>nn1:8020</value></property>\n<property><name>dfs.namenode.rpc-address.ns1.nn2</name><value>nn2:8020</value></property>","handlingStrategy":"validation","validationCode":"String nsId = DFSUtil.getNamenodeNameServiceId(conf);\nif (!HAUtil.isHAEnabled(conf, nsId)) {\n  throw new IOException(\"Refusing bootstrapStandby: HA not configured for \"\n      + \"nameservice '\" + nsId + \"' — set dfs.nameservices and \"\n      + \"dfs.ha.namenodes.\" + nsId);\n}","typeGuard":null,"tryCatchPattern":"try {\n  tool.run(argv); // BootstrapStandby\n} catch (HadoopIllegalArgumentException e) { // \"HA is not enabled...\"\n  // config problem: deploy full HA config to this node, then re-run\n}","preventionTips":["Deploy HA configuration (nameservice + both namenode ids + addresses) from one managed template to every NN host","Validate with 'hdfs getconf -nameservices' and 'hdfs getconf -namenodes' before running bootstrap","Ensure HADOOP_CONF_DIR points at the staged config on newly provisioned nodes"],"tags":["hdfs","namenode","bootstrap-standby","ha","missing-configuration"],"backgroundTag":"missing-ha-configuration","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}