hadoop - 在hadoop集群中每天限制清洁/ tmp是否正确
问题描述
我们有 HDP 集群版本 – 2.6.4
集群安装在 redhat 机器版本 – 7.2
我们注意到 JournalNodes 机器(主机)上的以下问题
我们有 3 台 JournalNodes 机器,在 /tmp 文件夹下我们有数千个空文件夹
drwx------. 2 hive hadoop 6 Dec 20 09:00 a962c02e-4ed8-48a0-b4bb-79c76133c3ca_resources
还有很多文件夹
drwxr-xr-x. 4 hive hadoop 4096 Dec 12 09:02 hadoop-unjar6426565859280369566
内容为
beeline-log4j.properties BeeLine.properties META-INF org sql-keywords.properties
/tmp 应根据配置文件每 10 天清除一次:
more /usr/lib/tmpfiles.d/tmp.conf
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
# See tmpfiles.d(5) for details
# Clear tmp directories separately, to make them easier to override
v /tmp 1777 root root 10d
v /var/tmp 1777 root root 30d
# Exclude namespace mountpoints created with PrivateTmp=yes
x /tmp/systemd-private-%b-*
X /tmp/systemd-private-%b-*/tmp
x /var/tmp/systemd-private-%b-*
X /var/tmp/systemd-private-%b-*/tmp
You have new mail in /var/spool/mail/root
所以我们将保留时间减少到1d而不是10d以避免这个问题
然后确实/tmp 只有一天的文件夹内容
但我想问以下问题
可以将 Hadoop 集群中 /tmp 的保留时间配置为 1day 吗?
(我几乎肯定没问题,但想听听更多意见)
第二
为什么 HIVE 会生成数千个空文件夹作为 XXXX_resources ,
是否可以从 HIVE 服务解决它,而不是限制 /tmp 上的保留
解决方案
只要仍有可用空间用于正常运行,在 /tmp 中有数千个文件夹是很正常的。许多进程都在使用 /tmp,包括 Hive、Pig 等。 /tmp 的一天保留期可能太短,因为通常 Hive 或其他 map-reduce 任务可以运行超过一天,但这取决于您的任务。HiveServer 应该删除临时文件,但是当任务失败或中止时,文件可能会保留,这也取决于 Hive 版本。最好配置一些保留,因为当 /tmp 中没有剩余空间时,一切都会停止工作。
另请阅读有关 HDFS 暂存目录保留的Jira 。
推荐阅读
- sql - SQL - 在列中查找具有特定值组合的行
- python - TypeError 虽然形状相同:如果不是 (target.size() == input.size()): 'int' object is not callable
- spring - 请求被拒绝,因为在 tomcat 中部署 spring boot 应用程序时 URL 未规范化
- amazon-web-services - 如何使用 AWS CLI 根据给定的日期范围(如 8 月 8 日至 8 月 15 日)从 S3 存储桶下载选择性日期范围文件?
- tensorflow - 如果输出是单热向量,如何自定义深度学习模型?
- qt - QComboBox 样式表在 Ubuntu 16.04 LTS 上不起作用
- lua - 如何在 C lua 模块中调用
- r - init_nloptr.c:35:19:致命错误:nlopt.h:没有这样的文件或目录
- git - 如何对git状态输出进行排序
- python - 熊猫读取没有标头的 JSON 文件