CentOS Hadoop格式化HDFS异常java.net.UnknownHostException

时间:2022-04-24 23:17:51

#bin/hadoop namenode -format

DEPRECATED: Use of this script to execute hdfs command is deprecated.

Instead use the hdfs command for it.



13/09/04 13:24:48 INFO namenode.NameNode: STARTUP_MSG:

/************************************************************

STARTUP_MSG: Starting NameNode

STARTUP_MSG:   host = java.net.UnknownHostException: localhost1: localhost1

STARTUP_MSG:   args = [-format]

STARTUP_MSG:   version = 2.1.0-beta

解决办法

1)使用hostname命令设置新的host name与/etc/hosts本机hostname一致

#hostname --file file_whose_content_is_the_hostname

2) # /sbin/service network restart

3) 重新执行命令

#bin/hadoop namenode -format

hadoop版本:hadoop-2.1.0-beta