2011-10-16 10 views
9

Tengo mysql DB en el servidor S1 (mysql versión 5.1.41-3ubuntu12.7-log), he creado master-slave para este DB en el servidor S2 (mysql versión 5.1.54-1ubuntu4-log).
DB en S1 estaba usando un archivo de datos (ibdata). después de descargar DB a S2, establezco innodb_file_per_table = 1. esto hizo que cada tabla tenga su propio archivo ibd. ahora todo salió bien y sin problemas.
pero después de reiniciar mysql en S2, me enfrentaba a un problema con conseguir este error:
Error 'Unknown table engine 'InnoDB'' on query. Default database: MyDB y cuando trato de mostrar los motoresError 'Motor de tabla desconocido' InnoDB '' en la consulta. Después de reiniciar mysql

 
show engines; 
+------------+---------+----------------------------------------------------------------+--------------+------+------------+ 
| Engine  | Support | Comment              | Transactions | XA | Savepoints | 
+------------+---------+----------------------------------------------------------------+--------------+------+------------+ 
| MyISAM  | DEFAULT | Default engine as of MySQL 3.23 with great performance   | NO   | NO | NO   | 
| MRG_MYISAM | YES  | Collection of identical MyISAM tables       | NO   | NO | NO   | 
| BLACKHOLE | YES  | /dev/null storage engine (anything you write to it disappears) | NO   | NO | NO   | 
| CSV  | YES  | CSV storage engine            | NO   | NO | NO   | 
| MEMORY  | YES  | Hash based, stored in memory, useful for temporary tables  | NO   | NO | NO   | 
| FEDERATED | NO  | Federated MySQL storage engine         | NULL   | NULL | NULL  | 
| ARCHIVE | YES  | Archive storage engine           | NO   | NO | NO   | 
+------------+---------+----------------------------------------------------------------+--------------+------+------------+ 

innodb no está en la lista.
en registro de errores que puedo ver esto:

 
InnoDB: Database physically writes the file full: wait... 
InnoDB: Cannot initialize created log files because 
InnoDB: data files are corrupt, or new data files were 
InnoDB: created when the database was started previous 
InnoDB: time but the database was not shut down 
InnoDB: normally after that. 
111016 8:24:11 [ERROR] Plugin 'InnoDB' init function returned error. 
111016 8:24:11 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 
111016 8:24:11 [Warning] Neither --relay-log nor --relay-log-index were used; so replication may break when this MySQL server acts as a slave and has his hostname changed!! Please use '--relay-log=S2-relay-bin' to avoid this problem. 

He tratado de eliminar ib_logfiles pero esto no funciona tan bien.
¿alguien se enfrentó a tal problema antes? cualquier idea es muy apreciada
Gracias

+0

tratar http://www.youdidwhatwithtsql.com/unknown-table-engine-innodb/760 – Bala

Respuesta

17

Puede eliminar los archivos de registro InnoDB en el directorio de datos de MySQL llamada ib_logfile0 y ib_logfile1. No elimine el archivo de datos InnoDB (ibdata1).

Después de eso, InnoDB intentará recuperarse después de reiniciar mysqld.

vistazo a archivo de registro principal:

120413 17:34:47 InnoDB: Initializing buffer pool, size = 64.0M 
120413 17:34:47 InnoDB: Completed initialization of buffer pool 
120413 17:34:47 InnoDB: Log file .\ib_logfile0 did not exist: new to be created 
InnoDB: Setting log file .\ib_logfile0 size to 32 MB 
InnoDB: Database physically writes the file full: wait... 
120413 17:34:48 InnoDB: Log file .\ib_logfile1 did not exist: new to be created 
InnoDB: Setting log file .\ib_logfile1 size to 32 MB 
InnoDB: Database physically writes the file full: wait... 
InnoDB: The log sequence number in ibdata files does not match 
InnoDB: the log sequence number in the ib_logfiles! 
120413 17:34:49 InnoDB: Database was not shut down normally! 
InnoDB: Starting crash recovery. 
+1

me acabas de salvar la vida. +1 – Clayton

+0

sí, en mi caso solo reinicie mysqld ayudado, gracias – Nedudi

1

¿Compiló mysql con innodb? Si es así, usted debe tener pegotes de líneas que se refieren a ella cuando se ejecuta este:

strings `which mysqld` | grep innodb 
+0

sí lo hice, y me han recibido una gran cantidad de la línea al ejecutar tu comando arriba ...también innodb engine estaba allí y funcionaba bien hasta que reinicié mysql !! – Alaa

2

creo configuración de MySQL para innodb si establece innodb_buffer_pool_size = 2G, innodb no va a funcionar.

Por lo general, da un error

"Unknown table engine 'InnoDB". 

si selecciona mesa con sistema de innodb tratar innodb_buffer_pool_size = 1G.

4

Tuve un problema similar después de colgar y reiniciar el servidor.

Los datos están correctos: el mensaje de error es muy engañoso.

Detenga el servicio MySQL, elimine los archivos de registro (ib_logfile*) de /var/lib/mysql y reinicie el servicio MySQL. Simplemente asegúrese al 100% que MySQL está realmente inactivo al eliminar los archivos de registro.

0

Tuve el mismo problema. La respuesta de Nikl me ayudó a encontrar el problema en el archivo de registro principal. InnoDB no pudo asignar la memoria requerida al inicio. Después de limpiar algunos otros procesos, todo comenzó correctamente.

registros mostraron lo siguiente:

160219 9:20:23 InnoDB: Error: cannot allocate 12884918272 bytes of InnoDB: memory with malloc! Total allocated memory InnoDB: by InnoDB 49601872 bytes. Operating system errno: 12 InnoDB: Check if you should increase the swap file or InnoDB: ulimits of your operating system. InnoDB: On FreeBSD check you have compiled the OS with InnoDB: a big enough maximum process size. InnoDB: Note that in most 32-bit computers the process InnoDB: memory space is limited to 2 GB or 4 GB. InnoDB: We keep retrying the allocation for 60 seconds...

Cuestiones relacionadas