Skip to main content

mysql restarts every 10 minutes

Comments

7 comments

  • cPRex Jurassic Moderator

    Hey there!  Could you confirm this inside the MySQL log file at /var/log/mysqld.log?  It would be odd that we would be restarting MySQL every 10 minutes without a reason.

    You could also check /var/log/chkservd.log to see if our automated monitoring tool is responsible for restarting the service.

    0
  • Mike St

    ok so I was checking things today, and aureport tells me that restartsrv_mysql is being called now once every 2 to 2 1/2 hours. Not sure why mysql continues to restart.

    I didn't do regular logging but I enabled the mysql error log and when I looked at it, there wasn't anything explainng anything wrong with mysql. I also checked dmesg and didn't find anything suggesting out of memory issues.

    what of your scripts would be involved in checking and restarting mysql randomly?

    0
  • cPRex Jurassic Moderator

    Nothing every happens randomly :D

    In the main MySQL log, which is located at /var/log/mysqld.log, do you see those restarts logged there? Here's what a restart block looks like on my personal system:

    2024-05-08T09:35:43.878268Z 12439 [System] [MY-013172] [Server] Received SHUTDOWN from user root. Shutting down mysqld (Version: 8.0.37).
    2024-05-08T09:35:46.500882Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.37)  MySQL Community Server - GPL.
    2024-05-08T09:35:46.888775Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.37) starting as process 508253
    2024-05-08T09:35:46.901923Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
    2024-05-08T09:35:47.415831Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
    2024-05-08T09:35:47.713212Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
    2024-05-08T09:35:47.741965Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.37'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MySQL Community Server - GPL.

    I stopped MySQL for a few minutes and let chksrvd restart the service, and this is what that restart looks like in the log:

    2024-11-14T16:04:22.161663Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.40) starting as process 2210651
    2024-11-14T16:04:22.169973Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
    2024-11-14T16:04:22.446493Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
    2024-11-14T16:04:22.616821Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
    2024-11-14T16:04:22.638019Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.40'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MySQL Community Server - GPL.

    That also would have triggered an email notification to the server admin.

    Does your log have similar entries? 

    0
  • Mike St

    I'm not sure what to put in my my.cnf file to enable logging because the normal logs were not being generated anymore but the error log was only to the time that mysql was first started. But now I ran checks and it seems mysql wants to stay running. I wonder if its because I removed old log files and old pids before restarting mysql.

    For now, I'll declare the mysql case as solved.

    0
  • cPRex Jurassic Moderator

    I hope that's all this one is!

    0
  • Mike St

    Something is going on with chkservd. My settings in WHM are to check services every 7200 seconds (2 hours). Every 2 1/2 hours MySQL restarts. (aureport shows restartsrv_mysql happening in that time), Its really strange.

    0
  • cPRex Jurassic Moderator

    At this point it would likely be best to create a ticket as I don't have a good explanation for what may be happening on this system.

    0

Please sign in to leave a comment.