![](/img/trans.png)
[英]Creation of symlink from job logs to ${hadoop.tmp.dir} failed in hadoop multinode cluster setup
[英]is it right to limit cleaning /tmp each day in hadoop cluster
我們有 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 的保留時間配置為 1 天?
(我幾乎可以肯定沒問題,但想聽聽更多意見)
第二
為什么 HIVE 會生成數千個空文件夾作為 XXXX_resources ,
是否有可能從 HIVE 服務中解決它,而不是限制 /tmp 上的保留
只要仍有可用空間可用於正常運行,在 /tmp 中有數千個文件夾是很正常的。 許多進程都在使用/tmp,包括Hive、Pig 等。/tmp 的一天保留期可能太小了,因為通常Hive 或其他map-reduce 任務可以運行一天以上,盡管這取決於您的任務。 HiveServer 應該刪除臨時文件,但是當任務失敗或中止時,這些文件可能會保留,這也取決於 Hive 版本。 最好配置一些保留,因為當 /tmp 中沒有剩余空間時,一切都會停止工作。
另請閱讀有關 HDFS 暫存目錄保留的Jira 。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.