Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

How to change hive session folder from /tmp to other folder

avatar
Contributor

I found there are 10,000+ folder owned by hive:hadoop under /tmp locally, folder name is {session_id}_resources(eg. 0003f01d-07e5-4caa-bb4f-61e62d35f426_resources). And the folder is empty, can I delete them? And how can I config to store them in another folder? They have been there 1 month ago. No one use these folder anymore.

I think it is created by hive session. I found JIRA describe similar bug: https://issues.apache.org/jira/browse/HIVE-4546, but this bug has been fixed from hive version 0.12.0. The hive version here is 1.2.1.2.6. It shouldn't have this issue again. Any idea on how to prevent leaving these hive session folder? Or is there a way to have these in a subfolder, e.g. /tmp/hive_session/0003f01d-07e5-4caa-bb4f-61e62d35f426_resources/

1 ACCEPTED SOLUTION

avatar
Contributor

Solution:

Go to Ambari Hive Configs page.

Then find Custom hive-site

Add following arguments:

hive.downloaded.resources.dir=/tmp/hive/${hive.session.id}_resources

Then save the modification and do a Rolling Restart of related component.

We can delete all ages {session_id}_resources folder under /tmp, and start a hive client, run some SQL, then check the new session folder will be generated in /tmp/hive/ folder.

View solution in original post

1 REPLY 1

avatar
Contributor

Solution:

Go to Ambari Hive Configs page.

Then find Custom hive-site

Add following arguments:

hive.downloaded.resources.dir=/tmp/hive/${hive.session.id}_resources

Then save the modification and do a Rolling Restart of related component.

We can delete all ages {session_id}_resources folder under /tmp, and start a hive client, run some SQL, then check the new session folder will be generated in /tmp/hive/ folder.