{"record":{"id":"23d397e827bc4638","repo":"apache/hadoop","slug":"remote-namenodes-not-correctly-configured","errorCode":null,"errorMessage":"Remote NameNodes not correctly configured!","messagePattern":"Remote NameNodes not correctly configured!","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"critical","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ha/EditLogTailer.java","lineNumber":206,"sourceCode":"  public EditLogTailer(FSNamesystem namesystem, Configuration conf) {\n    this.tailerThread = new EditLogTailerThread();\n    this.conf = conf;\n    this.namesystem = namesystem;\n    this.timer = new Timer();\n    this.editLog = namesystem.getEditLog();\n    this.lastLoadTimeMs = timer.monotonicNow();\n    this.lastRollTimeMs = timer.monotonicNow();\n\n    logRollPeriodMs = conf.getTimeDuration(\n        DFSConfigKeys.DFS_HA_LOGROLL_PERIOD_KEY,\n        DFSConfigKeys.DFS_HA_LOGROLL_PERIOD_DEFAULT,\n        TimeUnit.SECONDS, TimeUnit.MILLISECONDS);\n    List<RemoteNameNodeInfo> nns = Collections.emptyList();\n    if (logRollPeriodMs >= 0) {\n      try {\n        nns = RemoteNameNodeInfo.getRemoteNameNodes(conf);\n      } catch (IOException e) {\n        throw new IllegalArgumentException(\"Remote NameNodes not correctly configured!\", e);\n      }\n\n      for (RemoteNameNodeInfo info : nns) {\n        // overwrite the socket address, if we need to\n        InetSocketAddress ipc = NameNode.getServiceAddress(info.getConfiguration(), true);\n        // sanity check the ipc address\n        Preconditions.checkArgument(ipc.getPort() > 0,\n            \"Active NameNode must have an IPC port configured. \" + \"Got address '%s'\", ipc);\n        info.setIpcAddress(ipc);\n      }\n\n      LOG.info(\"Will roll logs on active node every \" +\n          (logRollPeriodMs / 1000) + \" seconds.\");\n    } else {\n      LOG.info(\"Not going to trigger log rolls on active node because \" +\n          DFSConfigKeys.DFS_HA_LOGROLL_PERIOD_KEY + \" is negative.\");\n    }\n    ","sourceCodeStart":188,"sourceCodeEnd":224,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ha/EditLogTailer.java#L188-L224","documentation":"Thrown by the standby NameNode's EditLogTailer constructor. When dfs.ha.log-roll.period >= 0 (default 120s), the tailer must find the other NameNodes in the nameservice to roll and tail their edit logs; RemoteNameNodeInfo.getRemoteNameNodes(conf) re-reads the HA topology (dfs.nameservices / dfs.internal.nameservices, dfs.ha.namenodes.<ns>, dfs.namenode.rpc-address.<ns>.<nn>) and throws IOException when it cannot resolve the peer NNs. The tailer wraps that IOException in IllegalArgumentException, which aborts NameNode startup or the transition to standby.","triggerScenarios":"Starting a NameNode (or transitioning it to standby) while log rolling is enabled and: (a) this NN's nameservice id has no dfs.ha.namenodes.<ns-id> entry, (b) an NN id listed there has no dfs.namenode.rpc-address.<ns-id>.<nn-id> so NameNode.getServiceAddress cannot build a socket address, or (c) a host in one of those addresses is unresolvable, making HAUtil.getConfForOtherNodes fail.","commonSituations":"Hand-edited hdfs-site.xml with a typo in dfs.ha.namenodes.* or a missing per-NN address suffix; cloning one node's config to another without the <ns-id>.<nn-id> suffixed keys; federation misconfiguration of dfs.internal.nameservices; DNS entries for NN hosts missing.","solutions":["Fix the HA topology in hdfs-site.xml: set dfs.ha.namenodes.<ns-id> to all NN ids and give every NN a dfs.namenode.rpc-address.<ns-id>.<nn-id> (and matching http address keys)","Verify the config as the NameNode resolves it: 'hdfs getconf -dfs.nameservices', 'hdfs getconf -dfs.ha.namenodes' and confirm each address resolves (host -t A <host>)","Fix hostname/DNS or /etc/hosts for every listed NN address if resolution is the failure","Only if you deliberately want no edit-log tailing (not recommended in HA): set dfs.ha.log-roll.period to a negative value so remote-NN discovery is skipped"],"exampleFix":"<!-- before: nn2 has no address -->\n<property><name>dfs.ha.namenodes.mycluster</name><value>nn1,nn2</value></property>\n<property><name>dfs.namenode.rpc-address.mycluster.nn1</name><value>nn1-host:8020</value></property>\n<!-- after -->\n<property><name>dfs.ha.namenodes.mycluster</name><value>nn1,nn2</value></property>\n<property><name>dfs.namenode.rpc-address.mycluster.nn1</name><value>nn1-host:8020</value></property>\n<property><name>dfs.namenode.rpc-address.mycluster.nn2</name><value>nn2-host:8020</value></property>","handlingStrategy":"validation","validationCode":"// Run before NN start / transitionToStandby on this host's effective config\nstatic void validateRemoteNameNodes(Configuration conf) throws IOException {\n  String nsId = DFSUtil.getNamenodeNameServiceId(conf);\n  if (nsId == null) return; // single-NN, no federation: nothing to check\n  String idsKey = \"dfs.ha.namenodes.\" + nsId;\n  String[] nnIds = conf.getTrimmedStrings(idsKey);\n  if (nnIds == null || nnIds.length == 0)\n    throw new IOException(idsKey + \" is not configured\");\n  for (String nnId : nnIds) {\n    String addrKey = \"dfs.namenode.rpc.address.\" + nsId + \".\" + nnId;\n    String addr = conf.get(addrKey);\n    if (addr == null || addr.isEmpty())\n      throw new IOException(addrKey + \" is not configured\");\n    InetAddress.getByName(addr.split(\":\")[0]); // fails on unresolvable host\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Template HA configs with the <ns-id>.<nn-id> suffixed address keys so a missing suffix cannot happen","Add a pre-deploy config lint (hdfs getconf + a key-presence check) to your provisioning pipeline","Resolve all NN hostnames on every node before starting or failing over","Keep both NNs' hdfs-site.xml byte-identical except where deployment tooling intentionally differs"],"tags":["hadoop","hdfs","high-availability","configuration","namenode","startup","edit-log"],"backgroundTag":"hadoop-ha-misconfiguration","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}