hadoop.tmp.dir 到底应该设置在哪里? core-site.xml 还是 hdfs-site.xml?

Where exactly should hadoop.tmp.dir be set? core-site.xml or hdfs-site.xml?

我问的是 Hadoop 2.x 系列。互联网上对此有相互矛盾的建议。就像在 case where he asks to specify it in core-site.xml and this SO answer 中提到 hadoop.tmp.dir 设置在 hdfs-site.xml 中一样。放哪个位置合适?

hadoop.tmp.dir(其他临时目录的基础)是属性,需要在core-site.xml中设置,就像在linux[=22中导出一样=]

例如:

<name>dfs.namenode.name.dir</name>
<value>file://${hadoop.tmp.dir}/dfs/name</value>

您可以像上面那样在 hdfs-site.xml 中使用 hadoop.tmp.dir 的引用

更多core-site.xml and hdfs-site.xml

有三个 HDFS 属性在其值中包含 hadoop.tmp.dir

dfs.name.dir:namenode存放其元数据的目录,默认值为${hadoop.tmp.dir}/dfs/name.

dfs.data.dir:HDFS数据块存放目录,默认值为${hadoop.tmp.dir}/dfs/data.

fs.checkpoint.dir: secondary namenode存放检查点的目录,默认值为${hadoop.tmp.dir}/dfs/namesecondary