温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

Hadoop使用时的常见问题以及解决方法

发布时间:2021-09-15 09:14:13 来源:亿速云 阅读:114 作者:chen 栏目:云计算

本篇内容主要讲解“Hadoop使用时的常见问题以及解决方法”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“Hadoop使用时的常见问题以及解决方法”吧!

1:Shuffle Error: Exceeded MAX_FAILED_UNIQUE_FETCHES; bailing-out Answer: 
程序里面需要打开多个文件,进行分析,系统一般默认数量是1024,(用ulimit -a可以看到)对于正常使用是够了,但是对于程序来讲,就太少了。 修改办法: 修改2个文件。 
        /etc/security/limits.conf vi /etc/security/limits.conf 加上: 
* soft nofile 102400 * hard nofile 409600  
        $cd /etc/pam.d/     $sudo vi login 
        添加        session    required     /lib/security/pam_limits.so  


2:Too many fetch-failures Answer: 

出现这个问题主要是结点间的连通不够全面。 1) 检查 、/etc/hosts    要求本机ip 对应 服务器名 
   要求要包含所有的服务器ip + 服务器名 2) 检查 .ssh/authorized_keys 
   要求包含所有服务器(包括其自身)的public key  


3:处理速度特别的慢 出现map很快 但是reduce很慢 而且反复出现 reduce=0%  Answer: 结合第二点,然后 

修改 conf/hadoop-env.sh 中的export HADOOP_HEAPSIZE=4000   


4:能够启动datanode,但无法访问,也无法结束的错误 

在重新格式化一个新的分布式文件时,需要将你NameNode上所配置的dfs.name.dir这一namenode用来存放NameNode 持久存储名字空间及事务日志的本地文件系统路径删除,同时将各DataNode上的dfs.data.dir的路径 DataNode 存放块数据的本地文件系统路径的目录也删除。如本此配置就是在
NameNode上删除
/home/hadoop/NameData,在DataNode上删除/home/hadoop/DataNode1和/home/hadoop/DataNode2。这是因为Hadoop在格式化一个新的分布式文件系统时,每个存储的名字空间都对应了建立时间的那个版本(可以查看/home/hadoop /NameData/current目录下的VERSION文件,上面记录了版本信息),在重新格式化新的分布式系统文件时,最好先删除NameData 目录。必须删除各DataNode的dfs.data.dir。这样才可以使namedode和datanode记录的信息版本对应。 

注意:删除是个很危险的动作,不能确认的情况下不能删除!!做好删除的文件等通通备份!!  

5:java.io.IOException: 

Could not obtain block: blk_194219614024901469_1100 file=/user/hive/warehouse/src_20090724_log/src_20090724_log 出现这种情况大多是结点断了,没有连接上。  

6:java.lang.OutOfMemoryError: Java heap space 
出现这种异常,明显是jvm内存不够得原因,要修改所有的datanode的jvm内存大小。 Java -Xms1024m -Xmx4096m 

一般jvm的最大内存使用应该为总内存大小的一半,我们使用的8G内存,所以设置为4096m,这一值可能依旧不是最优的值。 

7: Namenode in safe mode  解决方法 

bin/hadoop dfsadmin -safemode leave  


8:java.net.NoRouteToHostException: No route to host j解决方法: 

sudo /etc/init.d/iptables stop  


9:更改namenode后,在hive中运行select 依旧指向之前的namenode地址 这是因为:When youcreate a table, hive actually stores the location of the table (e.g. 

hdfs://ip:port/user/root/...) in the SDS and DBS tables in the metastore . So when I bring up a new cluster the master has a new IP, but hive's metastore is still pointing to the locations within the old 
cluster. I could modify the metastore to update with the new IP everytime I bring up a cluster. But the easier and simpler solution was to just use an elastic IP for the master 
所以要将metastore中的之前出现的namenode地址全部更换为现有的namenode地址

到此,相信大家对“Hadoop使用时的常见问题以及解决方法”有了更深的了解,不妨来实际操作一番吧!这里是亿速云网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI