我昨天犯了一个错误。我试图通过分离旧卷并附加新卷来增加现有 micro t2 实例的卷。但是,我没有注意快照,现在我的网站因为“无法与数据库建立连接”而关闭
150929 09:41:52 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
150929 9:41:52 [Note] Plugin 'InnoDB' is disabled.
150929 9:41:52 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
150929 9:41:52 [Note] - '0.0.0.0' resolves to '0.0.0.0';
150929 9:41:52 [Note] Server socket created on IP: '0.0.0.0'.
150929 9:41:52 [Note] Event Scheduler: Loaded 0 events
150929 9:41:52 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.5.42-log' socket: '/tmp/mysql.sock' port: 3306 Source distribution
150929 9:41:53 [Note] /usr/local/mysql/bin/mysqld: Normal shutdown
150929 9:41:53 [Note] Event Scheduler: Purging the queue. 0 events
150929 9:41:53 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete
当我试图停止 mysql 时,我得到以下信息:
Stoping LNMP...
Stoping nginx... done
* MySQL server PID file could not be found!
Gracefully shutting down php-fpm done
Starting LNMP...
Starting nginx... done
Starting MySQL
. * The server quit without updating PID file (/var/run/mysqld/mysqld.pid).
Starting php-fpm done
希望有人能帮助我。
最佳答案
看起来您的数据库在该卷上。 检查您是否已自动创建快照(EC2 - 右侧的快照)。 如果你有,那么:
- 选择快照
- 从顶部的“操作”中选择“创建卷”
- 设置参数并创建卷
现在“停止”实例(不要终止!),一旦停止 - 分离当前卷并附加您从快照创建的卷。
启动实例并检查它现在是否工作。
但是,如果您没有快照,则无事可做 - 您只需要从头开始设置数据库(创建新数据库、创建表等)。 如果 mysql 在停止/启动后不工作 - 尝试重新安装它,它应该重新创建现在可能丢失的数据文件夹。
关于php - AWS ubuntu lnmp+ wordpress down,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35320439/