运行mapreduce作业时出错:不是有效的inet地址

sqserrrh  于 2021-06-03  发布在  Hadoop
关注(0)|答案(1)|浏览(257)

我想尝试在windows上使用hadoop。我已将windows azure hdinsight预览作为单个节点安装在我的windows 7笔记本上。 Jmeter 板和节点已启动并运行,hdfs正在工作。但是,当我运行mapreduce作业时,它会失败,并显示错误消息“is not a valid inet address”:

c:\Hadoop\GettingStarted>powershell -ExecutionPolicy unrestricted /F runSamples.
ps1 w3c small java totalhits
Moved to trash: hdfs://localhost:8020/w3c/out
12/12/10 13:50:16 WARN mapred.JobClient: Use GenericOptionsParser for parsing th
e arguments. Applications should implement Tool for the same.
12/12/10 13:50:16 WARN util.NativeCodeLoader: Unable to load native-hadoop libra
ry for your platform... using builtin-java classes where applicable
12/12/10 13:50:16 WARN snappy.LoadSnappy: Snappy native library not loaded
12/12/10 13:50:16 INFO mapred.FileInputFormat: Total input paths to process : 1
12/12/10 13:50:17 INFO mapred.JobClient: Running job: job_201212101301_0001
12/12/10 13:50:18 INFO mapred.JobClient:  map 0% reduce 0%
12/12/10 13:50:27 INFO mapred.JobClient: Job complete: job_201212101301_0001
12/12/10 13:50:27 INFO mapred.JobClient: Counters: 0
12/12/10 13:50:27 INFO mapred.JobClient: Job Failed: Job initialization failed:
java.net.UnknownHostException: Marc_Red_Data is not a valid Inet address
        at org.apache.hadoop.net.NetUtils.verifyHostnames(NetUtils.java:569)
        at org.apache.hadoop.mapred.JobInProgress.initTasks(JobInProgress.java:7
12)
        at org.apache.hadoop.mapred.JobTracker.initJob(JobTracker.java:4214)
        at org.apache.hadoop.mapred.JobInitializationPoller$JobInitializationThr
ead.initializeJobs(JobInitializationPoller.java:137)
        at org.apache.hadoop.mapred.JobInitializationPoller$JobInitializationThr
ead.run(JobInitializationPoller.java:108)

Exception in thread "main" java.io.IOException: Job failed!
        at org.apache.hadoop.mapred.JobClient.runJob(JobClient.java:1265)
        at microsoft.hadoop.w3c.TotalHitsForPage.main(TotalHitsForPage.java:79)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:156)

当我查看作业日志时,我可以看到marc\u red\u数据的属性如下:

<property><name>mapreduce.job.submithost</name><value>Marc_Red_Data</value></property>

不知怎的它得到了名字,但我不知道如何解决这个问题。有人知道如何解决这个问题吗?

dsekswqp

dsekswqp1#

hadoop不喜欢机器的主机名中有下划线。编辑/etc/hostname和/etc/hosts并将marc\u red\u数据的两个示例都更改为marcreddata,然后重新启动。
我也碰到了同样的问题,当我找到你的帖子时,我注意到你的主机名和我的一样有下划线。我更改了机器的主机名,现在可以正常工作了。我怀疑hadoop使用的库试图解析主机名,就像解析url一样,而url不能有下划线,所以只能出错。
[编辑]我之前没有注意到您说您正在运行windows,因此更改主机名的过程会有所不同。http://www.howtogeek.com/howto/windows-vista/change-your-computer-name-in-windows-vista/

相关问题