UnknownHostException - 在Mac OSX Mavericks上格式化HDFS

时间:2014-04-09 22:24:53

标签: macos hadoop

我试图在运行OSX 10.9的MacBook Pro上以伪分布式模式运行Hadoop 2.3。我看到以下错误:

14/04/09 15:05:43 WARN net.DNS: Unable to determine address of the host-falling back to "localhost" address
java.net.UnknownHostException: crowlem8: crowlem8
    at java.net.InetAddress.getLocalHost(InetAddress.java:1473)
    at org.apache.hadoop.net.DNS.resolveLocalHostIPAddress(DNS.java:287)
    at org.apache.hadoop.net.DNS.<clinit>(DNS.java:58)
    at org.apache.hadoop.hdfs.server.namenode.NNStorage.newBlockPoolID(NNStorage.java:914)
    at org.apache.hadoop.hdfs.server.namenode.NNStorage.newNamespaceInfo(NNStorage.java:550)
    at org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:144)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:829)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1218)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1325)
Caused by: java.net.UnknownHostException: crowlem8
    at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)
    at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:901)
    at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1293)
    at java.net.InetAddress.getLocalHost(InetAddress.java:1469)

有关如何解决此问题的任何想法?我在CentOS上格式化HDFS时看到了related question有关UnknownHostExceptions的信息。根据答案,我不确定如何继续。

1 个答案:

答案 0 :(得分:0)

原来解决方案是将以下内容添加到/ etc / hosts: 127.0.0.1 localhost.localdomain localhost

在上面的语境中是crowlem8