#1  
Old 7th June 2008, 20:56
Hans Hans is offline
Moderator
 
Join Date: Dec 2005
Location: Montfoort, The Netherlands
Posts: 2,256
Thanks: 212
Thanked 648 Times in 294 Posts
Send a message via Skype™ to Hans
Default MySQL down

Yesterday (it was the first time ever) that the MySQL on one of my ispconfig servers went down.
Although, monit has been installed. Monit did not start the MySQL again.
Within the log files i could not find something related to the problem.

That this could happen was very unplesant.
I started mysql again with /etc/init.d/mysql start, but i would like to know how it could happen and why monit did not start mysql (as i expect it to).

I have these lines within the file /etc/monit/monitrc for mysql:

check process mysql with pidfile /var/run/mysqld/mysqld.pid
group database
start program = "/etc/init.d/mysql start"
stop program = "/etc/init.d/mysql stop"
if failed host 127.0.0.1 port 3306 then restart
if 5 restarts within 5 cycles then timeout

Can anyone advise me how to prevent this problem and tell me what the reason might be.
__________________
Hans

BB-Hosting | Quality Web Hosting since 2005
Reply With Quote
Sponsored Links
  #2  
Old 8th June 2008, 12:47
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,735 Times in 2,571 Posts
Default

Did you find any MySQL errors in your logs?

You can add this to the MySQL stanza in monit to watch the MySQL socket:

if failed unixsocket /var/run/mysqld/mysqld.sock protocol mysql then restart
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
The Following User Says Thank You to falko For This Useful Post:
Hans (8th June 2008)
  #3  
Old 8th June 2008, 16:31
Hans Hans is offline
Moderator
 
Join Date: Dec 2005
Location: Montfoort, The Netherlands
Posts: 2,256
Thanks: 212
Thanked 648 Times in 294 Posts
Send a message via Skype™ to Hans
Default

Thanks Falko,
I added that line as well and i hope it will restart mysql if it ever happens again. I try to find the cause within the log files one more time.
__________________
Hans

BB-Hosting | Quality Web Hosting since 2005
Reply With Quote
  #4  
Old 11th August 2008, 20:07
Hans Hans is offline
Moderator
 
Join Date: Dec 2005
Location: Montfoort, The Netherlands
Posts: 2,256
Thanks: 212
Thanked 648 Times in 294 Posts
Send a message via Skype™ to Hans
Default MySQL-server went down again

This afternoon it happened again that my MySQL-server went down and I don’t know why.

This is what I found in the /var/log/syslog:

Aug 11 14:32:01 server1 mysqld[30789]: 080811 14:32:01 [Note] /usr/sbin/mysqld: Normal shutdown

Aug 11 14:32:01 server1 mysqld[30789]:

Aug 11 14:32:03 server1 mysqld[30789]: 080811 14:32:03 InnoDB: Starting shutdown...

Aug 11 14:32:06 server1 mysqld[30789]: 080811 14:32:06 InnoDB: Shutdown completed; log sequence number 0 1984718085

Aug 11 14:32:06 server1 mysqld[30789]: 080811 14:32:06 [Note] /usr/sbin/mysqld: Shutdown complete

Aug 11 14:32:06 server1 mysqld[30789]:

Aug 11 14:32:06 server1 mysqld_safe[25747]: ended

Aug 11 14:32:06 server1 mysqld_safe[25818]: started

Aug 11 14:32:07 server1 mysqld[25821]: 080811 14:32:07 InnoDB: Started; log sequence number 0 1984718085

Aug 11 14:32:07 server1 mysqld[25821]: 080811 14:32:07 [Note] /usr/sbin/mysqld: ready for connections.

Aug 11 14:32:07 server1 mysqld[25821]: Version: '5.0.32-Debian_7etch6-log' socket: '/var/run/mysqld/mysqld.sock' port: 3306 Debian etch distribution

Aug 11 14:32:07 server1 /etc/mysql/debian-start[25859]: Upgrading MySQL tables if necessary.

Aug 11 14:32:08 server1 /etc/mysql/debian-start[25871]: Checking for crashed MySQL tables.

Aug 11 14:32:53 server1 monit[3598]: 'mysql' process PID changed to 25820

Aug 11 14:32:53 server1 monit[3598]: 'mysql' process PPID changed to 25783


I was able to restart it with /etc/init.d/mysql restart.

Monit did not restart MySQL, when MySQL-server went down.
How is that possible?
__________________
Hans

BB-Hosting | Quality Web Hosting since 2005

Last edited by Hans; 11th August 2008 at 20:45.
Reply With Quote
  #5  
Old 12th August 2008, 22:08
Hans Hans is offline
Moderator
 
Join Date: Dec 2005
Location: Montfoort, The Netherlands
Posts: 2,256
Thanks: 212
Thanked 648 Times in 294 Posts
Send a message via Skype™ to Hans
 
Default Problem seems to be solved.

It seemed that the MySQL threads go up to the maximum value within /etc/my.cnf and then drop. It seems also the reason that Monit could not restart MySQL-server again.

By increasing the max_connections setting for MySQL to a higher value, this can be avoided.
I hope that this problem is over now.

For more monitoring for MySQL, I also changed the MySQL section within /etc/monit/monitrc into:

#MySQL
check process mysql with pidfile /var/run/mysqld/mysqld.pid
group database
start program = "/etc/init.d/mysql start"
stop program = "/etc/init.d/mysql stop"
if failed host 127.0.0.1 port 3306 then restart
if failed unix "/var/lib/mysql/mysql.sock" then restart
if 5 restarts within 5 cycles then timeout
depends mysqld_init
depends mysqld_bin
depends mysqldsafe_bin
check file mysqld_init with path /etc/init.d/mysql
group database
check file mysqld_bin with path /usr/sbin/mysqld
group database
check file mysqldsafe_bin with path /usr/bin/mysqld_safe
group database

I want to thank Till & Falko for their help.
__________________
Hans

BB-Hosting | Quality Web Hosting since 2005
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Upgradeded to mysql4.1 breaks mysql client PoleCat Installation/Configuration 5 22nd April 2008 17:38
Problem installing MySQL on suse 10.3 Txchaser Installation/Configuration 20 18th April 2008 01:05
Management/system config/settings & /server/settings not working!! dactor Installation/Configuration 9 6th February 2008 09:11
Messed up ISPConfig-2.2.8 Upgrade Morons Installation/Configuration 4 29th November 2006 12:17
Mandriva 10.2 Perfect Setup Install Problems... ctroyp Installation/Configuration 12 30th December 2005 16:04


All times are GMT +2. The time now is 12:01.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.