运行bin/hdfs namenode -format报 WARN net.DNS: Unable to determine address of the host-falling back to "localhost" address

来源:2-4 安装小结

慕函数0603164

2017-03-12 20:05

初始化HDFS系统

    在hadop2.7.1目录下使用如下命令:

    bin/hdfs namenode -format

多谢大家帮我分析一下,谢谢了!

出现以下报错:

17/03/12 20:01:39 INFO util.GSet: Computing capacity for map NameNodeRetryCache
17/03/12 20:01:39 INFO util.GSet: VM type       = 64-bit
17/03/12 20:01:39 INFO util.GSet: 0.029999999329447746% max memory 889 MB = 273.1 KB
17/03/12 20:01:39 INFO util.GSet: capacity      = 2^15 = 32768 entries
Re-format filesystem in Storage Directory /chroot/hadoop/tmp/dfs/name ? (Y or N) Y
17/03/12 20:01:41 WARN net.DNS: Unable to determine local hostname -falling back to "localhost"
java.net.UnknownHostException: iZwz97cbcapiyem3o09u09Z: iZwz97cbcapiyem3o09u09Z: Name or service not known
	at java.net.InetAddress.getLocalHost(InetAddress.java:1505)
	at org.apache.hadoop.net.DNS.resolveLocalHostname(DNS.java:264)
	at org.apache.hadoop.net.DNS.<clinit>(DNS.java:57)
	at org.apache.hadoop.hdfs.server.namenode.NNStorage.newBlockPoolID(NNStorage.java:966)
	at org.apache.hadoop.hdfs.server.namenode.NNStorage.newNamespaceInfo(NNStorage.java:575)
	at org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:157)
	at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:991)
	at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1429)
	at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1554)
Caused by: java.net.UnknownHostException: iZwz97cbcapiyem3o09u09Z: Name or service not known
	at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)
	at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928)
	at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323)
	at java.net.InetAddress.getLocalHost(InetAddress.java:1500)
	... 8 more
17/03/12 20:01:41 WARN net.DNS: Unable to determine address of the host-falling back to "localhost" address
java.net.UnknownHostException: iZwz97cbcapiyem3o09u09Z: iZwz97cbcapiyem3o09u09Z: Name or service not known
	at java.net.InetAddress.getLocalHost(InetAddress.java:1505)
	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:966)
	at org.apache.hadoop.hdfs.server.namenode.NNStorage.newNamespaceInfo(NNStorage.java:575)
	at org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:157)
	at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:991)
	at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1429)
	at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1554)
Caused by: java.net.UnknownHostException: iZwz97cbcapiyem3o09u09Z: Name or service not known
	at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)
	at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928)
	at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323)
	at java.net.InetAddress.getLocalHost(InetAddress.java:1500)
	... 8 more
17/03/12 20:01:41 INFO namenode.FSImage: Allocated new BlockPoolId: BP-612298536-127.0.0.1-1489320101369
17/03/12 20:01:41 INFO common.Storage: Storage directory /chroot/hadoop/tmp/dfs/name has been successfully formatted.
17/03/12 20:01:41 INFO namenode.NNStorageRetentionManager: Going to retain 1 images with txid >= 0
17/03/12 20:01:41 INFO util.ExitUtil: Exiting with status 0
17/03/12 20:01:41 INFO namenode.NameNode: SHUTDOWN_MSG: 
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at java.net.UnknownHostException: iZwz97cbcapiyem3o09u09Z: iZwz97cbcapiyem3o09u09Z: Name or service not known
************************************************************/

输出的最顶部有一句:

STARTUP_MSG: Starting NameNode
STARTUP_MSG:   host = java.net.UnknownHostException: iZwz97cbcapiyem3o09u09Z: iZwz97cbcapiyem3o09u09Z: Name or service not known


写回答 关注

1回答

  • 慕函数0603164
    2017-03-12 21:58:20

    问题已经解决:http://blog.csdn.net/xianglingchuan/article/details/61651339

认识Hadoop--基础篇

Hadoop入门视频教程,大数据人才的入门首选

138835 学习 · 348 问题

查看课程

相似问题