Get java.net.UnknownHostException when use hadoop-ha?
Asked Answered
C

3

2

I got an exception when i execute the command sudo -u hdfs hdfs balancer -threshold 5.

Here is the Exception.

RuntimeException: java.lang.IllegalArgumentException: java.net.UnknownHostException: nameservice1

Here is my core-site.xml.

    <property>
            <name>fs.defaultFS</name>
            <value>hdfs://nameservice1</value>
    </property>

Here is my hdfs-site.xml.

    <property>
            <name>dfs.nameservices</name>
            <value>nameservice1</value>
    </property>
    <property>
            <name>dfs.ha.namenodes.nameservice1</name>
            <value>nn1,nn2</value>
    </property>

Someone help me?

Cutinize answered 23/2, 2016 at 3:6 Comment(0)
C
2

I ran into this problem when setting up HA. The problem is that I set dfs.client.failover.proxy.provider.mycluster based on the reference documentation. When I replaced mycluster with my nameservice name, everything worked!

Reference: https://issues.apache.org/jira/browse/HDFS-12109

Confine answered 19/11, 2020 at 1:54 Comment(1)
nice, i add this property in hdfs-site.xml, and run hdfs dfs -ls /, everything is ok.Seduction
M
0

You can try after putting the port number at core-site.xml.

<property>
   <name>fs.defaultFS</name>
   <value>hdfs://nameservice1:9000</value>   
</property>

And make sure your machine's /etc/hosts file has entry for nameservice1. For Example (let you machine IP is 192.168.30.102)

127.0.0.1           localhost       
192.168.30.102      nameservice1
Mohenjodaro answered 28/2, 2016 at 21:35 Comment(1)
When configuring HA, HDFS shouldn't even attempt to resolve the name nameservice1, it should rely on dfs.namenode.rpc-address.nameservice1.nn1 (resp .nn2). The way you set it up, how do you configure two namenodes and automatic failover?Jonquil
G
0
<property>
  <name>dfs.client.failover.proxy.provider.nameservice1</name>  
  <value>
     org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider
  </value>
 </property>
Gaynor answered 18/4, 2017 at 8:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.