我想尝试在Windows上使用Hadoop。我已将Windows Azure HDInsight Preview安装为Windows 7笔记本电脑上的单个节点。仪表板和节点已启动并正在运行,HDFS正在运行。但是,当我运行MapReduce作业时,它失败并显示错误消息“不是有效的Inet地址”:
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)
当我查看joblog时,我可以看到存在Marc_Red_Data是以下属性:
<property><name>mapreduce.job.submithost</name><value>Marc_Red_Data</value></property>
不知怎的,它得到了名字,但我不知道如何解决这个问题。有谁知道如何解决这个问题?
答案 0 :(得分:4)
如果机器的主机名中有下划线,Hadoop不喜欢它。编辑/ etc / hostname和/ etc / hosts并将Marc_Red_data的两个实例更改为MarcRedData,然后重新启动。
我一直在反对同样的问题,当我找到你的帖子时,我注意到你的主机名有下划线。我更改了机器的主机名,现在工作正常。我怀疑hadoop正在使用一些试图像URL那样解析主机名的库,并且URL不能有下划线,所以它只是出错了。
[编辑]我之前没有注意到您说您正在运行Windows,因此更改主机名的过程会有所不同。 http://www.howtogeek.com/howto/windows-vista/change-your-computer-name-in-windows-vista/