The embedded MySQL database got corrupted and the following is seen in the FMS log. How can it be restored to a recoverable state?
STDIN/mysqld:InnoDB: Serious error! InnoDB is trying to free page 1004749
STDIN/mysqld:InnoDB: though it is already marked as free in the tablespace!
STDIN/mysqld:InnoDB: The tablespace free space info is corrupt.
STDIN/mysqld:InnoDB: You may need to dump your InnoDB tables and recreate the whole
STDIN/mysqld:InnoDB: database!
STDIN/mysqld:InnoDB: Please refer to
STDIN/mysqld:InnoDB: http://dev.mysql.com/doc/refman/5.1/en/forcing-recovery.html
STDIN/mysqld:InnoDB: about forcing recovery.
STDIN/mysqld:121018 14:58:24 InnoDB: Assertion failure in thread 5252 in file .\fsp\fsp0fsp.c line
STDIN/mysqld:InnoDB: We intentionally generate a memory trap.
STDIN/mysqld:InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
STDIN/mysqld:InnoDB: If you get repeated assertion failures or crashes, even
STDIN/mysqld:InnoDB: immediately after the mysqld startup, there may be
STDIN/mysqld:InnoDB: corruption in the InnoDB tablespace. Please refer to
STDIN/mysqld:InnoDB: http://dev.mysql.com/doc/refman/5.1/en/forcing-recovery.html
STDIN/mysqld:InnoDB: about forcing recovery.
STDIN/mysqld:121018 14:58:24 - mysqld got exception 0xc0000005 ;
STDIN/mysqld:This could be because you hit a bug. It is also possible that this binary
STDIN/mysqld:or one of the libraries it was linked against is corrupt, improperly built,
STDIN/mysqld:or misconfigured. This error can also be caused by malfunctioning hardware.
STDIN/mysqld:We will try our best to scrape up some info that will hopefully help diagnose
STDIN/mysqld:the p
NOTE: The following should be done as a last resort in an attempt to restore the corrupted embedded MySQL database. This may cause some data loss but will at least restore the database in a recoverable state so that the FMS can be started. If you have a good backup of the entire Foglight directory, then use that to attempt a restoration first.
Backup the entire Foglight installation directory
Go to $foglight_directory\bin and attempt to start the MySQL database manually:
runDb.bat
Review the EmbeddedDatabase_*.log generated under the $foglight_directory\logs folder. If the same error is found, then move to the next steps.
Go to $foglight_directory\bin and run the following to shutdown MySQL:
shutdownDb.bat
Go to $foglight directory\mysql and edit the my.ini and add the following under the [mysqld] section:
innodb_force_recovery=4
Save the file
Go to $foglight directory\bin and attempt to start the MySQL database manually:
runDb.bat
This should start MySQL successfully bypassing any errors.
Open command prompt and go to $foglight_directory\mysql\bin and run:
mysql --host=localhost --port=13306 --user=foglight --password=foglight
use foglight;
select count(*) from alarm_alarm;
See if you are able to query the table.
Run mysqlcheck to ensure all the foglight tables are OK.
e.g.
mysqlcheck --host=localhost --port=13306 --user=foglight --password=foglight --databases foglight
Take note of the number of existing tables:
use foglight;
show tables;
Run mysqldump to export all the tables to flat file
e.g.
mysqldump --host=localhost --port=13306 --user=foglight --password=foglight --databases foglight > dumpfile.sql
Drop the 'foglight' database
drop database foglight;
Stop MySQL by running shutdownDb.bat. Edit the my.ini and remove the innodb_force_recovery=4 option. Start using runDB.bat
Create the foglight database:
create database foglight;
Restore the dump to load the tables and data
use foglight;
source dumpfile.sql;
Run 'show tables' to ensure that the number of tables tally with the count earlier. If there are tables missing, try to figure out how you can extract them manually and recreate it. Examine the dump if it is exported in the first place. If not, go to $foglight_directory=\scripts\sql and open the mysql_create_schema.sql to get the create statement for the missing tables. This should at least create the table but no data in it.
Go to \scripts\sql and open the mysql_create_schema.sql file. Extract all the CREATE PROCEDURE statements and save it as a file, e.g. proc.sql. You would go to the top of the file and search for CREATE PROCEDURE, this will be your start point and copy the rest of the block till the end of the file (except the alter statement at the end).
Run the proc.sql
use foglight;
source proc.sql;
Shutdown MySQL - shutdownDb.bat. Start the FMS normally.
Login to see if dashboards and showing data.
Take a backup of the current Foglight directory or MySQL.
© ALL RIGHTS RESERVED. Feedback 使用条款 隐私 Cookie Preference Center