全部,
下面我将在amazonec2上设置hadoop单节点集群。namenode和datanode都运行在一个amazonec2示例上。
http://www.michael-noll.com/tutorials/running-hadoop-on-ubuntu-linux-single-node-cluster/http://www.slideshare.net/benjaminwootton/configuring-your-first-hadoop-cluster-on-ec2
我有一个c++的hdfs客户机程序,它不在ec2示例上运行。
当我的客户机程序试图将数据写入集群时,出现了以下异常:,
2014-02-13 14:37:01,027 INFO hdfs.DFSClient(DFSOutputStream.java:createBlockOutputStream(1175)) - Exception in createBlockOutputStream
org.apache.hadoop.net.ConnectTimeoutException: 60000 millis timeout while waiting for channel to be ready for connect. ch : java.nio.channels.SocketChannel[connection-pending remote=/10.168.15.63:50010]
at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:532)
at org.apache.hadoop.hdfs.DFSOutputStream.createSocketForPipeline(DFSOutputStream.java:13
该文件是在hdfs上创建的,但为空。例外情况似乎是无法在datanode上创建数据块,因为使用的是私有ip地址(10.168.15.63:50010)而不是公共ip地址(ec2-54---233.us--1.compute.amazonaws.com或54...233)。我没有固定的ip地址(即弹性ip地址)。
下面是如何在hdfs-site.xml中定义datanode地址。
<property>
<name>dfs.datanode.address</name>
<value>ec2-54-xxx-xxx-233.us-xxx-1.compute.amazonaws.com:50010</value>
<description>The host and port that the MapReduce job tracker runs at. If "local", then jobs are run in-process as a single map and reduce task.
</description>
</property>
为了让远程客户端可以访问ec2上的hadoop集群,还需要配置什么?
提前感谢您的帮助!
暂无答案!
目前还没有任何答案,快来回答吧!