• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

Hdfs连接报错java.net.ConnectException: Connection timed out: no further information

武飞扬头像
赵广陆
帮助1


1 连接超时

学新通

2 排查具体问题

2.1.检查网络能不能ping通,防火墙问题

由于有Hue可以访问,网络没有问题或者看是否连通,因为可能防ping

telnet www.百度.com 80

2.2 检查zookeeper有没有开启

2.3 最后检查Hue中Hdfs节点挂掉

学新通
最后可以看出上述问题都没有所以大环境是没有错,那就是代码的问题

3 解决方法

问题在于使用本地读取hdfs文件时,服务器datanode使用的是内网进行通信,所以我们把hdfs-site.xml和core-site.xml文件导入到Idea中时,需要修改hdfs-site.xml中的以下配置:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://blog.csdn.net/ZGL_cyy/article/details/configuration.xsl"?>
<!--
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License. See accompanying LICENSE file.
-->

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

<configuration>
	<property>
		<name>dfs.namenode.name.dir</name>
		<value>/opt/hdfs/namenode</value>
		<description>NameNode directory for namespace and transaction logs storage.</description>
	</property>
	<property>
		<name>dfs.datanode.data.dir</name>
		<value>/opt/hdfs/datanode</value>
		<description>DataNode directory</description>
	</property>
	<property>
		<name>dfs.replication</name>
		<value>2</value>
	</property>
	<property>
		<name>dfs.permissions</name>
		<value>false</value>
		<description>need not permissions</description>
	</property>
	<property>
		<name>dfs.webhdfs.enabled</name>
		<value>true</value>
	</property>
	<property>
		<name>dfs.datanode.max.xcievers</name>
		<value>4096</value>
	</property>
	<property>
		<name>dfs.client.use.datanode.hostname</name>
		<value>true</value>
	</property>
</configuration>

学新通

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /boutique/detail/tanhibfcih
系列文章
更多 icon
同类精品
更多 icon
继续加载