我对此感到很困惑。我有 New Relic 跟踪,服务器上还有日志文件,但 MySQL 一直停止运行,当我检查日志时,我只看到这些,New Relic 什么都没有。我只看到“正在初始化缓冲池,大小 = 128.0M”,是不是内存不足了?
root@ps1:/var/log/mysql# cat error.log
140619 23:12:10 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
140619 23:12:10 [Note] Plugin 'FEDERATED' is disabled.
140619 23:12:10 InnoDB: The InnoDB memory heap is disabled
140619 23:12:10 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140619 23:12:10 InnoDB: Compressed tables use zlib 1.2.3.4
140619 23:12:10 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
140619 23:12:10 InnoDB: Completed initialization of buffer pool
140619 23:12:10 InnoDB: Fatal error: cannot allocate memory for the buffer pool
140619 23:12:10 [ERROR] Plugin 'InnoDB' init function returned error.
140619 23:12:10 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
140619 23:12:10 [ERROR] Unknown/unsupported storage engine: InnoDB
140619 23:12:10 [ERROR] Aborting
140619 23:12:10 [Note] /usr/sbin/mysqld: Shutdown complete
140619 23:12:11 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
140619 23:12:11 [Note] Plugin 'FEDERATED' is disabled.
140619 23:12:11 InnoDB: The InnoDB memory heap is disabled
140619 23:12:11 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140619 23:12:11 InnoDB: Compressed tables use zlib 1.2.3.4
140619 23:12:11 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
140619 23:12:11 InnoDB: Completed initialization of buffer pool
140619 23:12:11 InnoDB: Fatal error: cannot allocate memory for the buffer pool
140619 23:12:11 [ERROR] Plugin 'InnoDB' init function returned error.
140619 23:12:11 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
140619 23:12:11 [ERROR] Unknown/unsupported storage engine: InnoDB
140619 23:12:11 [ERROR] Aborting
140619 23:12:11 [Note] /usr/sbin/mysqld: Shutdown complete
140620 0:37:36 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
140620 0:37:36 [Note] Plugin 'FEDERATED' is disabled.
140620 0:37:36 InnoDB: The InnoDB memory heap is disabled
140620 0:37:36 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140620 0:37:36 InnoDB: Compressed tables use zlib 1.2.3.4
140620 0:37:36 InnoDB: Initializing buffer pool, size = 128.0M
140620 0:37:36 InnoDB: Completed initialization of buffer pool
140620 0:37:36 InnoDB: highest supported file format is Barracuda.
InnoDB: Log scan progressed past the checkpoint lsn 1072329170
140620 0:37:36 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
InnoDB: Doing recovery: scanned up to log sequence number 1072330346
140620 0:37:36 InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percents: 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
InnoDB: Apply batch completed
140620 0:37:37 InnoDB: Waiting for the background threads to start
140620 0:37:38 InnoDB: 5.5.35 started; log sequence number 1072330346
140620 0:37:38 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
140620 0:37:38 [Note] - '127.0.0.1' resolves to '127.0.0.1';
140620 0:37:38 [Note] Server socket created on IP: '127.0.0.1'.
140620 0:37:38 [Note] Event Scheduler: Loaded 0 events
140620 0:37:38 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.5.35-0ubuntu0.12.04.2' socket: '/var/run/mysqld/mysqld.sock' port: 3306 (Ubuntu)
140620 0:37:39 [ERROR] /usr/sbin/mysqld: Table './2mbetterfutures/wp_options' is marked as crashed and should be repaired
140620 0:37:39 [Warning] Checking table: './2mbetterfutures/wp_options'
140620 0:37:39 [ERROR] /usr/sbin/mysqld: Table './2mbetterfutures/wp_postmeta' is marked as crashed and should be repaired
140620 0:37:39 [Warning] Checking table: './2mbetterfutures/wp_postmeta'
140620 0:37:39 [ERROR] /usr/sbin/mysqld: Table './2mbetterfutures/wp_posts' is marked as crashed and should be repaired
140620 0:37:39 [Warning] Checking table: './2mbetterfutures/wp_posts'
140620 0:37:39 [ERROR] /usr/sbin/mysqld: Table './2mbetterfutures/wp_rg_form_view' is marked as crashed and should be repaired
140620 0:37:39 [Warning] Checking table: './2mbetterfutures/wp_rg_form_view'
140620 0:37:39 [ERROR] /usr/sbin/mysqld: Table './delawarebasindrinkingwater/asd235_options' is marked as crashed and should be repaired
140620 0:37:39 [Warning] Checking table: './delawarebasindrinkingwater/asd235_options'
140620 0:37:39 [ERROR] /usr/sbin/mysqld: Table './delawarebasindrinkingwater/asd235_rg_form_view' is marked as crashed and should be repaired
140620 0:37:39 [Warning] Checking table: './delawarebasindrinkingwater/asd235_rg_form_view'
140620 0:37:39 [ERROR] /usr/sbin/mysqld: Table './delawarebasindrinkingwater/asd235_rpf_log' is marked as crashed and should be repaired
140620 0:37:39 [Warning] Checking table: './delawarebasindrinkingwater/asd235_rpf_log'
140620 0:37:39 [ERROR] /usr/sbin/mysqld: Table './realmenrealfires/z_answers' is marked as crashed and should be repaired
140620 0:37:39 [Warning] Checking table: './realmenrealfires/z_answers'
140620 0:37:39 [ERROR] /usr/sbin/mysqld: Table './realmenrealfires/z_events' is marked as crashed and should be repaired
140620 0:37:39 [Warning] Checking table: './realmenrealfires/z_events'
140620 0:37:39 [ERROR] /usr/sbin/mysqld: Table './realmenrealfires/z_my_users' is marked as crashed and should be repaired
140620 0:37:39 [Warning] Checking table: './realmenrealfires/z_my_users'
140620 0:37:39 [ERROR] /usr/sbin/mysqld: Table './realmenrealfires/z_options' is marked as crashed and should be repaired
140620 0:37:39 [Warning] Checking table: './realmenrealfires/z_options'
140620 0:37:39 [ERROR] /usr/sbin/mysqld: Table './realmenrealfires/z_rg_form_view' is marked as crashed and should be repaired
140620 0:37:39 [Warning] Checking table: './realmenrealfires/z_rg_form_view'
140620 0:37:39 [ERROR] /usr/sbin/mysqld: Table './smc_tbep_befloridian/asd235_options' is marked as crashed and should be repaired
140620 0:37:39 [Warning] Checking table: './smc_tbep_befloridian/asd235_options'
140620 0:37:39 [ERROR] /usr/sbin/mysqld: Table './smc_tbep_befloridian/asd235_rg_form_view' is marked as crashed and should be repaired
140620 0:37:39 [Warning] Checking table: './smc_tbep_befloridian/asd235_rg_form_view'
答案1
errno 12 确实意味着Cannot allocate memory
,所以您的内存不知何故不足。您应该减少虚拟机的内存消耗或为其提供更多内存。