これは私のWordpress Siteがなぜ「データベース接続を確立する際にエラーが発生しました」というエラーでクラッシュするのかわかりません。EC2インスタンス - Wordpressデータベースがクラッシュし続ける
mysqlサービスを再起動すると一時的にこの問題は解決されるようですが、必然的に何度もクラッシュします。
私はそれがメモリの問題かもしれないと思ったので、私は1gbから2gbにインスタンスをアップグレードしました。しかし、何も変更されていないようです。私はむしろメモリに関連していない場合、これのための膨大な余分な費用を支払うつもりはないです。
クラッシュに関連するmysqlログファイルの一部です。すべてのクラッシュは、以下が含まれているように見える:
160519 13:03:21 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
160519 13:03:21 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
160519 13:03:21 [Note] /usr/libexec/mysql55/mysqld (mysqld 5.5.46) starting as process 18275 ...
160519 13:03:21 [Note] Plugin 'FEDERATED' is disabled.
160519 13:03:21 InnoDB: The InnoDB memory heap is disabled
160519 13:03:21 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160519 13:03:21 InnoDB: Compressed tables use zlib 1.2.8
160519 13:03:21 InnoDB: Using Linux native AIO
160519 13:03:21 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
160519 13:03:21 InnoDB: Completed initialization of buffer pool
160519 13:03:21 InnoDB: Fatal error: cannot allocate memory for the buffer pool
160519 13:03:21 [ERROR] Plugin 'InnoDB' init function returned error.
160519 13:03:21 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
160519 13:03:21 [ERROR] Unknown/unsupported storage engine: InnoDB
160519 13:03:21 [ERROR] Aborting
160519 13:03:21 [Note] /usr/libexec/mysql55/mysqld: Shutdown complete
**** **** UPDATE
は、だから私は下に述べたようにinnodb_buffer_pool_sizeのサイズを変更してもスワップファイルを作ってきました。私のサイトはまだ数時間おきにクラッシュし、私はゆっくりと生きる意志を失っています。
160507 16:28:20 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
160507 16:28:20 [Note] /usr/libexec/mysql55/mysqld (mysqld 5.5.46) starting as process 26457 ...
160507 16:28:20 [Note] Plugin 'FEDERATED' is disabled.
160507 16:28:20 InnoDB: The InnoDB memory heap is disabled
160507 16:28:20 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160507 16:28:20 InnoDB: Compressed tables use zlib 1.2.8
160507 16:28:20 InnoDB: Using Linux native AIO
160507 16:28:20 InnoDB: Initializing buffer pool, size = 128.0M
160507 16:28:20 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
160507 16:28:20 InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
160507 16:28:21 InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
160507 16:28:21 InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: 127 rollback segment(s) active.
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
160507 16:28:21 InnoDB: Waiting for the background threads to start
160507 16:28:22 InnoDB: 5.5.46 started; log sequence number 0
160507 16:28:22 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
160507 16:28:22 [Note] - '0.0.0.0' resolves to '0.0.0.0';
160507 16:28:22 [Note] Server socket created on IP: '0.0.0.0'.
160507 16:28:22 [Note] Event Scheduler: Loaded 0 events
160507 16:28:22 [Note] /usr/libexec/mysql55/mysqld: ready for connections.
Version: '5.5.46' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
160507 17:56:05 [Note] /usr/libexec/mysql55/mysqld: Normal shutdown
160507 17:56:05 [Note] Event Scheduler: Purging the queue. 0 events
160507 17:56:05 InnoDB: Starting shutdown...
160507 17:56:06 InnoDB: Shutdown completed; log sequence number 2733606
160507 17:56:06 [Note] /usr/libexec/mysql55/mysqld: Shutdown complete
データベースに負荷がかかる原因があります。スワップメモリを増やしてみて、クエリを確認したり、プラグインを無効にしてクラッシュが再び発生したかどうかを確認してください。 –
これを試してみますが、毎回アカウントの権限が失われたり、 – zarate32
この質問を確認するhttp://stackoverflow.com/questions/25965638/mysql-fatal-error-cannot-allocate-memory-for-the-buffer-pool – error2007s