Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

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
Not applicable

@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
Not applicable

@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