Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-15193

Improving the error message for missing `dfs.namenode.rpc-address.$NAMESERVICE`

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 3.3.0
    • hdfs
    • None
    • Reviewed

    Description

      I set `dfs.nameservices` with the value of one name service (let’s say `ns1` for simplicity) and forgot to set `dfs.namenode.rpc-address.ns1`. 

      Then I got an error message:

      [ERROR] testNonFederation(org.apache.hadoop.hdfs.tools.TestGetConf)  Time elapsed: 0.195 s <<< ERROR!
      java.io.IOException: Incorrect configuration: namenode address dfs.namenode.servicerpc-address or dfs.namenode.rpc-address is not configured.
          at org.apache.hadoop.hdfs.DFSUtil.getNNServiceRpcAddressesForCluster(DFSUtil.java:629)
          at org.apache.hadoop.hdfs.tools.TestGetConf.getAddressListFromConf(TestGetConf.java:132)
          at org.apache.hadoop.hdfs.tools.TestGetConf.verifyAddresses(TestGetConf.java:234)
          at org.apache.hadoop.hdfs.tools.TestGetConf.testNonFederation(TestGetConf.java:308)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
          at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
          at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
          at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
          at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:298)
          at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:292)
          at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          at java.lang.Thread.run(Thread.java:748)
      

       

      The error message above told me that `dfs.namenode.rpc-address` or `dfs.namenode.servicerpc-address` should be set.

      However, the actual reason for the error is that `dfs.namenode.rpc-address.ns1` or `dfs.namenode.servicerpc-address.ns1` is not set.

       

      How to improve 

      I wrote a patch to improve the error message. Here is the current error message:

      [ERROR] testNonFederation(org.apache.hadoop.hdfs.tools.TestGetConf)  Time elapsed: 0.195 s <<< ERROR!
      java.io.IOException: Incorrect configuration: namenode address dfs.namenode.servicerpc-address[.$NAMESERVICE] or dfs.namenode.rpc-address[.$NAMESERVICE] is not configured.
      

      Then the users can immediately know that they should set `dfs.namenode.rpc-address.ns1` or `dfs.namenode.servicerpc-address.ns1` according to the error message.

       

      Attachments

        1. HDFS-15193-001.patch
          1.0 kB
          Ctest
        2. HDFS-15193-002.patch
          1.0 kB
          Ctest
        3. HDFS-15193-003.patch
          2 kB
          Ctest
        4. HDFS-15193-004.patch
          2 kB
          Ctest

        Activity

          People

            ctest.team Ctest
            ctest.team Ctest
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: