- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
mysql log cleanup on a Hive server
Created 12-08-2021 08:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a Hive server in my cluster running a MySQL instance. The logfile /var/run/mysqld/mysqld.log is getting really large and I need to figure out the proper way to prune it.
The server it's running on is CentOS 7. Can I just 'cat /dev/null > mysqld.log' to clear it out, or are there other considerations? Can I get away with simply stopping the MySQL instance briefly to delete or 'zero out' the file, or do I need to stop all the services on that Hive master node in Ambari?
Please advise if you can.
Thanks,
Mike
Created 12-08-2021 01:18 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @MikeB
Make sure you are not running anything on the cluster at the time when you are cleaning up the MySQL log file.
1. Stop the MySQL service.
2. Remove the log file.
3. You can add this parameter in the my.cnf which will limit the size of the MySQL logs on that node.
____
# relay log restrictions
relay-log-space-limit=1G
____
This will limit the new mysqld logs to be of max 1Gb.
Created 12-08-2021 01:22 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please check official mysql documentation as well.
https://dev.mysql.com/doc/refman/5.7/en/log-file-maintenance.html
Created 12-16-2021 11:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@MikeB Has the reply helped resolve your issue? If so, please mark the appropriate reply as the solution, as it will make it easier for others to find the answer in the future. Thanks.
Regards,
Diana Torres,Community Moderator
Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.
Learn more about the Cloudera Community:
