为什么Hadoop不能在cygwin下使用Windows 7?

时间:2013-04-27 04:31:25

标签: hadoop

我正在尝试在Windows 7上的cygwin中安装和启动hadoop 1.1.2。我在尝试运行一个简单的工作时遇到以下问题:

bin/hadoop jar hadoop-*-examples.jar pi 10 100

13/04/26 17:56:10 WARN hdfs.DFSClient: DataStreamer Exception: org.apache.hadoop.ipc.RemoteException: java.io.IOException: File /user/username/PiEstimator_TMP_3_141592654/in/part0 could only be replicated to 0 nodes, instead of 1
        at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getAdditionalBlock(FSNamesystem.java:1639)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.addBlock(NameNode.java:736)
        at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)

我的配置如下:

mapred-site.xml中

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<!-- Put site-specific property overrides in this file. -->

<configuration>
<property>
<name>mapred.job.tracker</name>
<value>localhost:9001</value>
</property>
</configuration>

HDFS-site.xml中

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<!-- Put site-specific property overrides in this file. -->

<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
</configuration>

芯-site.xml中

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<!-- Put site-specific property overrides in this file. -->

<configuration>
<property>
<name>fs.default.name</name>
<value>hdfs://localhost:9000</value>
</property>
</configuration>

2 个答案:

答案 0 :(得分:0)

答案在日志中。这里会有一个特定的异常,很可能是一个文件访问问题,要求你chmod 755 -R某个目录及其内容。

答案 1 :(得分:0)

此错误不是因为您在Windows上尝试Hadoop。这是因为您的DataNode存在一些问题。除了Chris Gerken所提出的观点之外,还有其他一些原因。我最近回答了类似的问题。你应该看看它。 Upload data to HDFS running in Amazon EC2 from local non-Hadoop Machine