Mysqld errors even after a repair

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
JakeHatMacys
Posts: 281
Joined: Thu Sep 25, 2014 3:21 pm

Mysqld errors even after a repair

Post by JakeHatMacys »

Been getting this all morning and a /usr/local/nagiosxi/scripts/repairmysql.sh nagios repair isn't fixing it...

Code: Select all

151116 14:29:25 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_logentries' is marked as crashed and last (automatic?) repair failed
151116 14:29:25 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_logentries' is marked as crashed and last (automatic?) repair failed
151116 14:29:25 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_logentries' is marked as crashed and last (automatic?) repair failed
151116 14:29:25 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_logentries' is marked as crashed and last (automatic?) repair failed
151116 14:29:28 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_logentries' is marked as crashed and last (automatic?) repair failed
During my first repair I Did see this:

myisamchk: error: myisam_sort_buffer_size is too small
MyISAM-table 'nagios_logentries.MYI' is not fixed because of errors
Try fixing it by using the --safe-recover (-o), the --force (-f) option or by not using the --quick (-q) flag


But have no idea what that means. Any ideas????
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Mysqld errors even after a repair

Post by tgriep »

The logentries table can get quite large and the sort buffer size needs to be increased to repair it.
Run the following as root on the XI server to repair the database

Code: Select all

service mysqld stop
cd /var/lib/mysql/nagios
myisamchk -r -f * --sort_buffer_size=2G
service mysqld start
rm -f /usr/local/nagiosxi/var/dbmaint.lock
php /usr/local/nagiosxi/cron/dbmaint.php
If you still get the buffer size too small, try increasing the to --sort_buffer_size=3G and run the repair above again.
Be sure to check out our Knowledgebase for helpful articles and solutions!
JakeHatMacys
Posts: 281
Joined: Thu Sep 25, 2014 3:21 pm

Re: Mysqld errors even after a repair

Post by JakeHatMacys »

Looks like that got her done.

Thx!

Should I alter the mysqld repair script to account for this???? If so could you help out with that??? O.o
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Mysqld errors even after a repair

Post by tgriep »

This is the file you can edit to add that option to the myisamchk command

Code: Select all

/usr/local/nagiosxi/scripts/repairmysql.sh
Search for this line and add the buffer size that you used to repair the table

Code: Select all

cmd="/usr/bin/myisamchk -r -f"
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked