mysql伺服器定期崩潰

mysql伺服器定期崩潰

我正在 ubuntu 伺服器上執行 drupal 實例。然而,mysql伺服器似乎經常會定期崩潰。

我正在獲取的日誌是這樣的:

131221  4:22:54 [Note] /usr/sbin/mysqld: Shutdown complete

131221  4:22:55 [Note] Plugin 'FEDERATED' is disabled.
131221  4:22:55 InnoDB: The InnoDB memory heap is disabled
131221  4:22:55 InnoDB: Mutexes and rw_locks use GCC atomic builtins
131221  4:22:55 InnoDB: Compressed tables use zlib 1.2.3.4
131221  4:22:55 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
131221  4:22:55 InnoDB: Completed initialization of buffer pool
131221  4:22:55 InnoDB: Fatal error: cannot allocate memory for the buffer pool
131221  4:22:55 [ERROR] Plugin 'InnoDB' init function returned error.
131221  4:22:55 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
131221  4:22:55 [ERROR] Unknown/unsupported storage engine: InnoDB
131221  4:22:55 [ERROR] Aborting

131221  4:22:55 [Note] /usr/sbin/mysqld: Shutdown complete

131223  8:22:00 [Note] Plugin 'FEDERATED' is disabled.
131223  8:22:00 InnoDB: The InnoDB memory heap is disabled
131223  8:22:00 InnoDB: Mutexes and rw_locks use GCC atomic builtins
131223  8:22:00 InnoDB: Compressed tables use zlib 1.2.3.4
131223  8:22:00 InnoDB: Initializing buffer pool, size = 128.0M
131223  8:22:00 InnoDB: Completed initialization of buffer pool
131223  8:22:00 InnoDB: highest supported file format is Barracuda.
InnoDB: Log scan progressed past the checkpoint lsn 4844461078
131223  8:22:00  InnoDB: Database was not shut down normally!

您對如何解決這個問題有什麼建議嗎?我嘗試在 my.cnf 中使用各種數字,但我沒有運氣。

答案1

您的系統似乎沒有足夠的備用記憶體用於 innodb 緩衝池。您可以嘗試減少 my.cnf 檔案中 innodb_buffer_pool 的大小

innodb_buffer_pool_size = 10M

例如,然後重新啟動mysql。減少 innodb 緩衝池大小可能會影響系統的效能,因此您需要意識到這一點,也許還需要考慮一些其他調整。

相關內容