I have built a three-node galera cluster, so it is a Master-Master replication structure. But sometimes the first node goes down and I can't find the problem causing this. I am only looking at /var/log/syslog files. Where should I look to find the problems? Is there other log files I can look on production environment? Where the database admins looks for db errors?
Asked
Active
Viewed 38 times
0
Rick James
- 78,038
- 5
- 47
- 113
-
1Does this answer your question? mysql replication master 5.5 slave 5.1 error on create database – John K. N. Jul 13 '21 at 06:00
1 Answers
3
You should look at the MariaDB error log. The authoritative documentation on this is found in the MariaDB Knowledgebase: Error Log.
If you're using Ubuntu, then I assume you have systemd, which means you can also see the error log with:
journalctl -u mariadb.service
... although I personally don't think this is as good/nice as MariaDB's own error log file. So it might be worth finding that, or configuring MariaDB to produce an error log.
In the mariadb client, you should check the following status variable:
SHOW VARIABLES LIKE 'log_error';
If this is empty, then by default the error log is written to the ${hostname}.err file in your datadir directory, and the datadir can be found with:
SHOW VARIABLES LIKE 'datadir';
For more details, please see the documentation page I linked to above.
dbdemon
- 6,351
- 4
- 19
- 38
-
1Note a blank
log_errorindicates its going to stdout/stderr. If you are running containers look at the logs of the running/stopped container using docker/podman (whichever started the container). – danblack Jul 13 '21 at 01:25