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

为什么Hadoop不能在cygwin下使用Windows7?,hadoop,Hadoop,我正在尝试在Windows7上的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

我正在尝试在Windows7上的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>

mapred.job.tracker
本地主机:9001
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>

dfs.replication
1.
core-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>

fs.default.name
hdfs://localhost:9000

答案在日志中。这里将详细介绍一个特定的异常,很可能是文件访问问题,要求您chmod 755-R某些目录及其内容。

此错误不是因为您试图在Windows上使用Hadoop。这是因为您的DataNode存在一些问题。除了Chris Gerken提出的观点外,还有其他一些原因。我最近回答了一个类似的问题。你应该看看

哪个日志?有那么多。。。namenode,secondarynamenode,taskrunner,jobtracker…@Damassusi:检查所有日志。或者一个简单的方法是启动dfs,然后再次运行启动脚本-它应该显示所有节点都在运行,而不是某些节点正在启动。检查未正常启动和运行的节点的日志。我执行了start-all.sh脚本。start-all和start-dfs之间有什么不同吗?在以后的版本中,start-all.sh已被弃用,取而代之的是另外两个版本。检查文档以查看应该运行哪些脚本。