0

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

核心站点.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>
4

2 回答 2

0

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

于 2013-04-27T05:04:01.143 回答
0

此错误不是因为您尝试在 Windows 上使用 Hadoop。这是因为您的 DataNode 存在问题。除了 Chris Gerken 提出的观点外,还可能有其他一些原因。我最近回答了一个类似的问题。你应该看看它。从本地非 Hadoop 机器将数据上传到在 Amazon EC2 中运行的 HDFS

于 2013-04-27T15:39:02.017 回答