View Full Version : mysql going down like every 2 weeks
sander815
04-03-2004, 04:19 PM
every 2-3 weeks or so, mysql goes down
phpBB : Critical Error
Could not connect to the database
no errors in mysql log, just restart it and its ok
what causes that?
already upgraded to 4.0.18
DirectAdmin Support
04-04-2004, 02:27 PM
What about /var/log/messages?
How much ram do you have and are you using any swap (possibly running out of memory?)
Double check free disk space.
John
sander815
04-04-2004, 03:05 PM
256 mb memory
47 gb disk space free from 80
DirectAdmin Support
04-04-2004, 03:31 PM
Run "top" to see if any of the swap is being used. Once it's all gone, then your system will run out of memory and die.
You could put a restart cron for mysql to be run once a week (RedHat):
echo "0 6 * * 1 /sbin/service mysqld restart" >> /etc/crond.d/directadmin_cron
killall -HUP crond
John
sander815
04-05-2004, 01:55 AM
Mem: 1031532K av, 991016K used, 40516K free, 0K shrd, 86348K buff
Swap: 522104K av, 240K used, 521864K free 777984K cached
this weekend again 2 times down
could it have something to do with sysbk running?
DirectAdmin Support
04-05-2004, 11:29 AM
Hello,
Yes, it's possible. I'm not aware of what actions sysbk takes, so can't really comment on it.
Your ram seems fine. (you actually have 1 gig of ram)
John
sander815
04-05-2004, 03:47 PM
upgraded it to 1gb.....no succes
i don't know if, when sysbk is backing up mysql, mysql can't access the db's, and goes down because of that?
ProWebUK
04-05-2004, 08:07 PM
Try disabling sysbk or running it manually a few times and see if that makes any difference?
Chris
mainswitch
04-06-2004, 12:44 PM
Hi
i'm the host
we have upgrade RAM from 256 to 1gb
MYSQL will shutdown when sysbk will backup mysql
on the exact time.
the log files are empty. so no info why its shutdown.
and it won't restart
i've disable sysbk and everything is working
but there is no backup :)
I just downloaded it and sysbk and one of the thing syou could do, is to modify the inernals.sysbak file around line 151. It reads:
if [ ! -f "$MYSQL_PID" ]; then
$MYSQL_INIT start >> /dev/null 2>&1
fi
That is saying that if the $mysql.pid file does not exist then restart it and redirect all output to /dev/null. To debug this problem here is what I would do. I would change the above lines to something similar to:
if [ ! -f "$MYSQL_PID" ]; then
$MYSQL_INIT start >> /tmp/mysql_init.$$ 2>&1
else
echo $MYSQL_PID already existed >> /tmp/mysql_init.$$ 2>&1
fi
That will create a new file in /tmp called mysql_init.${pid_of_sysbk} and contain the result of the '/etc/init.d/mysql start' command or if the /var/run/mysql.pid file already existed so it did not do the startup.
My guess is that the pid file never got removed. Of course if it did and mysql never started, you should have some sort of error message in that file, and you will just need to address that error.
Dr-Host
04-07-2004, 03:53 PM
well I got the same prob only my SQL dies every few hours
my TOP is
00:56:48 up 3 days, 23:31, 1 user, load average: 21.07, 21.01, 19.80
324 processes: 313 sleeping, 10 running, 1 zombie, 0 stopped
CPU states: 50.6% user 49.3% system 0.0% nice 0.0% iowait 0.0% idle
Mem: 1546608k av, 1531996k used, 14612k free, 0k shrd, 120804k buff
1071308k actv, 97888k in_d, 134208k in_c
Swap: 522104k av, 25964k used, 496140k free 649304k cached
httpd takes all the CPU usage
I got more then 25+ httpd & MySQL pids running all of my clients are leaving me because of this issue
Mybe its the Apche 1.3.29
I wanna upgrade to 2.40.x but I can't because of config issues if anyone can help me with the config problem so I can upgrade and see if that is the problem
DirectAdmin Support
04-08-2004, 10:01 AM
Have you setup an optimized /etc/my.cnf file?
http://www.directadmin.com/forum/showthread.php?s=&threadid=132
Maybe give that a shot.
John
Dr-Host
04-08-2004, 02:27 PM
with /etc/my.cnf file sql dies within 20-30min
without it, it works for a day or two and then slows the machine down making me to restart the sql and the httpd to get back to normal usage
sander815
04-09-2004, 01:28 PM
stopping sysbk didn't solve it...down again today
Originally posted by sander815
stopping sysbk didn't solve it...down again today
You don't happen to be running a process monitor like PRM? I could see that killing mysql if it exceeds a predetermined limit.
mainswitch
04-09-2004, 04:22 PM
So today without sysbk MYSQL goes down on strange time.
In mysql error log i see this
Can't start server : Bind on TCP / IP port : Address allready in use
Do you have another mysqld server running.
but i will checkout
http://www.directadmin.com/forum/showthread.php?s=&threadid=132
DirectAdmin Sales
04-10-2004, 11:14 AM
Hello,
Check the boot directory for a duplicate mysql boot file.
Redhat: /etc/init.d/mysqld
FreeBSD: /usr/local/etc/rc.d/mysqld
These are the files that should be there.
Mark
mainswitch
04-12-2004, 05:57 PM
Redhat
/etc/init.d
i've file mysql and file mysqld
paul
ProWebUK
04-12-2004, 06:01 PM
remove the one named mysql and also check there is only 1 instance shown in chkconfig
chkconfig --list
Chris
mainswitch
04-13-2004, 03:36 AM
mysqld 0:off 1:off 2:on 3:off 4:on 5:off 6:off
mysql 0:off 1:off 2:on 3:on 4:on 5:on 6:off
So i will remove mysql
and use only mysqld
sander815
04-14-2004, 05:27 AM
could it be that the mysql server goes down, because of spiders from search machines like google, that scan the 2 phpbb forums running here, and thus create an awful lot of session ids for them that cause the mysqld to go down?
can i deny them access with someting like this in root dir:?
User-agent: *
Disallow: /cgi-bin/
Disallow: /forum
robots.txt file
vBulletin® v3.7.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.