Support Questions

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

How do you delete old Ambari Operations History

avatar

In Ambari 2.2.1 how can I delete old Ambari Server Ops History?

I think that the history of tasks is stored in /var/lib/ambari-agent/data.

Can I simply delete the folder contents?

1 ACCEPTED SOLUTION

avatar

@William Gonzalez

Deleting whole "data" directory is not good. you might face the following kind of error. Because the "data" directory contains some files like "version" (which contains the agent version info),

OSError: [Errno 2] No such file or directory: '/var/lib/ambari-agent/data/status_command.json'
INFO 2016-11-30 10:08:54,666 StackVersionsFileHandler.py:107 - Creating stacks versions file at /var/lib/ambari-agent/data/current-stack
ERROR 2016-11-30 10:08:54,666 StackVersionsFileHandler.py:48 - Can't read versions file:

However if you want to clean old actions then you can manually delete the following files from the "/var/lib/ambari-agent/data"

-> command-*.json

-> errors-*.txt

-> output-*.txt

.

View solution in original post

2 REPLIES 2

avatar

@William Gonzalez

Deleting whole "data" directory is not good. you might face the following kind of error. Because the "data" directory contains some files like "version" (which contains the agent version info),

OSError: [Errno 2] No such file or directory: '/var/lib/ambari-agent/data/status_command.json'
INFO 2016-11-30 10:08:54,666 StackVersionsFileHandler.py:107 - Creating stacks versions file at /var/lib/ambari-agent/data/current-stack
ERROR 2016-11-30 10:08:54,666 StackVersionsFileHandler.py:48 - Can't read versions file:

However if you want to clean old actions then you can manually delete the following files from the "/var/lib/ambari-agent/data"

-> command-*.json

-> errors-*.txt

-> output-*.txt

.

avatar

Thanks. Yea I meant the contents (text files) not the directory. This makes sense. Thanks I will try that