hadoop、hive常见问题及解决方式
1、hive查询卡死
现象:执行hive查询时,迟迟不能出现map-reduce任务进度
原因:空间不足导致,清理掉无用的文件,释放出空间即可。通常建议剩余空间为查询数据的两倍
2、hdfs使用空间超出实际占用空间
现象:通过hdfs dfs-du-h/命令查看到各个目录所占的空间
原因:因为删除操作,大量的垃圾文件堆积在/user/root/.Trash ,这个目录可视为垃圾回收区,对应的配置为:
<property> <name>fs.trash.interval</name> <value>1440</value> <description>Number of minutes between trash checkpoints. If zero, the trash feature is disabled. </description> </property>
确认无用后,删除即可。
hdfs dfs -rm -r /user/root/.Trash
通过此项,释放了100多G的磁盘空间。
开启trash之后,其实在执行删除时也能够看到日志:
18/01/04 09:04:19 INFO fs.TrashPolicyDefault: Moved: hdfs://nameservice1/xxx/xxx/xxx/20170601/xxx.txt to trash at: hdfs://nameservice1/user/root/.Trash/Current/xxx/xxx/xxx/xxx/xxx.txt这时删除并非真正删除,而只是移动到了trash区。
3、手动释放系统cache
现象:使用free -m查询内存使用状况时,发现free空间只有不足1G,而buff/cache占用的几十G的空间。这是linux系统本身的策略,并非真实的内存不足。访问文件过多时就会产生这种现象。但free空间不足,也会导致系统运行缓慢。
total used free shared buff/cache available Mem: 64260 19600 26140 5724 18519 38336 Swap: 2047 246 1801
必要时可使用命令:
echo 3 > /proc/sys/vm/drop_caches手动释放内存。但需要谨慎,执行前最好使用sync 将dirty的内容写回硬盘 ,并且确认不会对其他正在执行中的任务产生影响。
上一篇:
JS实现多线程数据分片下载
下一篇:
人工智能发展史——卷积神经网络