Closed tooliedotter closed 3 months ago
You could disable binary logging by adding skip-log-bin
in the mariadb.cnf
file under [mysqld] directive.
That's great, I'm happy to add that directive. Two questions:
$ sudo find . -name mariadb.*
./etc/monit/conf.d/mariadb.conf
./opt/bitnami/bndiagnostic/original-data/permissions/mariadb.permissions
./opt/bitnami/mariadb/lib/pkgconfig/mariadb.pc
./opt/bitnami/mariadb/share/policy/selinux/mariadb.te
./opt/bitnami/mariadb/share/mariadb.logrotate
./opt/bitnami/mariadb/include/mysql/server/private/mariadb.h
Apologies, the configuration file should be /opt/bitnami/mariadb/conf/my.cnf
To enable archiving of the log entries I recommend following the official guide:
https://mariadb.com/kb/en/general-query-log/ https://mariadb.com/kb/en/purge-binary-logs/
Thanks Michiel, I found the config file and made the suggested change.
Now when I run the SHOW BINARY LOGS command, I get this:
MariaDB [(none)]> show binary logs;
ERROR 1381 (HY000): You are not using binary logging
MariaDB [(none)]>
which seems appropriate. However, running the PURGE BINARY LOGS file gets me this error:
MariaDB [(none)]> PURGE BINARY LOGS BEFORE '2023-12-31 11:59:59';
Error: #1046 No database selected
and I still have 17GB mysqld.log file that I need to empty or reduce. What do I do now?
The log filled up the hard drive again, so I stopped MariaDB, downloaded the log and manually removed 47,401,349 lines. The error seemed to be an endless repetition of the following:
2024-02-11 8:01:05 210172 [ERROR] Incorrect definition of table mysql.column_stats: expected column 'hist_type' at position 9 to have type enum('SINGLE_PREC_HB','DOUBLE_PREC_HB','JSON_HB'), found type enum('SINGLE_PREC_HB','DOUBLE_PREC_HB').
2024-02-11 8:01:05 210172 [ERROR] Incorrect definition of table mysql.column_stats: expected column 'histogram' at position 10 to have type longblob, found type varbinary(255).
OK question number 1 in https://github.com/bitnami/vms/issues/1457#issuecomment-2016676948 is solved with these two commands which were affirmed in several support websites as correcting the error. They IMMEDIATELY worked for me.
ALTER TABLE mysql.column_stats MODIFY histogram longblob;
ALTER TABLE mysql.column_stats MODIFY hist_type enum('SINGLE_PREC_HB','DOUBLE_PREC_HB','JSON_HB');
I'll await your answer to question number 2 in the response above.
Hi @tooliedotter
And I still need to know how to reactivate the archiving of the log contents. Neither of the links you provided answers that question.
You deactivated the binary logging as posted above. The error you got when running the "PURGE" command is that you didn't select any database. You can use the following to purge the binary logging
use DATABASE_NAME;
PURGE BINARY LOGS BEFORE '2024-03-01 12:00:00';
Regarding the errors in the log, you have different options.
https://docs.bitnami.com/general/apps/joomla/administration/configure-use-logrotate/ https://www.digitalocean.com/community/tutorials/how-to-manage-logfiles-with-logrotate-on-ubuntu-16-04
Hi Juan,
Hi @tooliedotter,
Thanks for the information on logrotate, I'll try to reestablish the prior configuration. Any ideas as to why it would stop rotating the logs? I'm assuming that the AMI would have had it set up from the start.
If the log files have grown too large, logrotate may not rotate them because of size restrictions. Another cause could be the disk space available.
Thanks for the explanation Michiel. It's counter-intuitive that the logrotate would stop rotating at the time it most needs to function.
I just checked the /opt/bitnami/mariadb/logs folder, and it appears that the log rotation has resumed. Thanks for your help, we can close this thread.
Platform
AWS
bndiagnostic ID know more about bndiagnostic ID
9555ca43-7080-bfe0-4a73-9ce0a9b8c46d
bndiagnostic output
===== Begin of bndiagnostic tool output =====
[Resources]
Your disk is almost full: You could try to increase your instance's storage.
Please check your cloud provider's documentation for more information.
Your instance has little available RAM memory.
You could try to increase your instance's memory. Please check your cloud provider's documentation for more information.
You can also enable swap memory to improve performance.
https://docs.bitnami.com/installer/faq/linux-faq/administration/increase-m emory-linux/
[Connectivity]
Server ports 22, 80 and/or 443 are not publicly accessible. Please check the following guide to open server ports for remote access:
https://docs.bitnami.com/general/faq/administration/use-firewall/
[Mariadb]
Found recent error messages in the MariaDB error log:
Please check the following guide to troubleshoot MariaDB issues:
https://docs.bitnami.com/aws/apps/wordpress/troubleshooting/debug-errors-m ariadb/
bndiagnostic was not useful. Could you please tell us why?
I am already aware that the disk is nearly full; the huge MariaDB Log file is why!
Describe your issue as much as you can
The mysqld.log file has grown to 16.5GB in size; it appears to have stopped archiving each week. The most recent log archive date is 5 weeks ago. In order to do anything I had to delete some files, but that doesn't stop the MariaDB log file from continuing to grow. I was planning to upgrade my server next month, but what do I do about this out-of-control log? How can I get the automatic archiving/purge cycle restarted?