尝试连接到hadoop datanode时出现超时错误

时间:2017-09-09 04:59:31

标签: hadoop hdfs ambari

我在尝试将文件放入hdfs时遇到此错误。

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.1.1.14:50010]

我查找了解决方案,我发现您需要将此属性添加到hdfs-site.xml:

<property>
  <name>dfs.client.use.datanode.hostname</name>
  <value>true</value>
</property>   

我使用ambari来管理我的hadoop服务。如何在我重新启动Ambari上的hdfs后添加属性而不将其重置为默认值?我在运行HDP 2.6.1.0的单节点集群上。

更新:管理以向hdfs-site.xml添加属性

  <property>
      <name>dfs.datanode.use.datanode.hostname</name>
      <value>true</value>
  </property>


  <property>
      <name>dfs.client.use.datanode.hostname</name>
      <value>true</value>
    </property>

但是,我仍然收到相同的超时错误。

1 个答案:

答案 0 :(得分:0)

在hdfs site xml

中使用它
<property> 
   <name>dfs.namenode.name.dir</name> 
   <value>file:/path/to/hadoop/namenode</value> 
 </property> 

 <property> 
   <name>dfs.datanode.data.dir</name> 
   <value>file:/path/to/hadoop/datanode</value> 
 </property> 
相关问题