首先,您需要正确创建临时文件夹。使用 hadoop 用户,运行以下命令:
$ hdfs dfs -mkdir /tmp
$ hdfs dfs -chmod -R 1777 /tmp
您可能想要删除 /tmp 目录的当前内容。
对于 hive 用户,如果您对 scratchdir 有类似的问题,请编辑文件 hive/conf/hive-site.xml
<property>
<name>hive.exec.local.scratchdir</name>
<value>${system:java.io.tmpdir}/${system:user.name}</value>
<description>Local scratch space for Hive jobs</description>
</property>
<property>
<name>hive.downloaded.resources.dir</name>
<value>${system:java.io.tmpdir}/${hive.session.id}_resources</value>
<description>Temporary local directory for added resources in the remote file system.</description>
</property>
<property>
<name>hive.scratch.dir.permission</name>
<value>777</value>
<description>The permission for the user specific scratch directories that get created.</description>
</property>