{"record":{"id":"ba6eb0cca4aab98a","repo":"apache/hadoop","slug":"cannot-use-secondarynamenode-in-an-ha-cluster-the","errorCode":null,"errorMessage":"Cannot use SecondaryNameNode in an HA cluster. The Standby Namenode will perform checkpointing.","messagePattern":"Cannot use SecondaryNameNode in an HA cluster\\. The Standby Namenode will perform checkpointing\\.","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/SecondaryNameNode.java","lineNumber":190,"sourceCode":"  \n  @VisibleForTesting\n  void setNameNode(NamenodeProtocol namenode) {\n    this.namenode = namenode;\n  }\n\n  /**\n   * Create a connection to the primary namenode.\n   */\n  public SecondaryNameNode(Configuration conf)  throws IOException {\n    this(conf, new CommandLineOpts());\n  }\n  \n  public SecondaryNameNode(Configuration conf,\n      CommandLineOpts commandLineOpts) throws IOException {\n    try {\n      String nsId = DFSUtil.getSecondaryNameServiceId(conf);\n      if (HAUtil.isHAEnabled(conf, nsId)) {\n        throw new IOException(\n            \"Cannot use SecondaryNameNode in an HA cluster.\" +\n            \" The Standby Namenode will perform checkpointing.\");\n      }\n      NameNode.initializeGenericKeys(conf, nsId, null);\n      initialize(conf, commandLineOpts);\n    } catch (IOException e) {\n      shutdown();\n      throw e;\n    } catch (HadoopIllegalArgumentException e) {\n      shutdown();\n      throw e;\n    }\n  }\n  \n  public static InetSocketAddress getHttpAddress(Configuration conf) {\n    return NetUtils.createSocketAddr(conf.getTrimmed(\n        DFSConfigKeys.DFS_NAMENODE_SECONDARY_HTTP_ADDRESS_KEY,\n        DFSConfigKeys.DFS_NAMENODE_SECONDARY_HTTP_ADDRESS_DEFAULT));","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/SecondaryNameNode.java#L172-L208","documentation":"Error \"Cannot use SecondaryNameNode in an HA cluster. The Standby Namenode will perform checkpointing.\" thrown in apache/hadoop.","triggerScenarios":"The SecondaryNameNode is started in a cluster configured with HDFS High Availability.","commonSituations":"Legacy startup scripts still launching secondarynamenode after migrating to HA with JournalNodes.","solutions":["Do not run the SecondaryNameNode in an HA cluster; the Standby NameNode performs checkpointing automatically."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}