AWS EC2 t2.micro实例非常不稳定 [英] AWS EC2 t2.micro instance very unstable

查看:762
本文介绍了AWS EC2 t2.micro实例非常不稳定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在AWS EC2 t2.micro实例上运行wordpress页面.别无所求,只是一个简单的wordpress网站.

I'm running a wordpress page on an AWS EC2 t2.micro instance. Nothing fancy but just a simple wordpress site.

每隔几周就一直在发生这种情况:

It has been happening pretty consistently that every few weeks:

  1. 我的页面将无法访问,ssh也将无法访问
  2. 在仪表板上检查时,一切看起来正常,没有警告或投诉
  3. 在AWS管理面板上重新启动它,检查之一将失败:实例可访问性检查在(时间)失败"

系统日志显示有内核崩溃(所有日志复制在下面).是什么原因造成的? AWS方面的硬件是否不良?这真的让我很困惑,请帮忙.谢谢!

System log shows that there's a kernel panic (all log copied below). What could cause this? bad hardware at AWS side? This really puzzles me a lot, please help. Thanks!

[2950123.794183] end_request: I/O error, dev xvda, sector 13514688
[2950123.797618] end_request: I/O error, dev xvda, sector 13514712
[2950123.798170] end_request: I/O error, dev xvda, sector 13514776
[2950123.798170] end_request: I/O error, dev xvda, sector 13514816
[2950123.798170] end_request: I/O error, dev xvda, sector 13514872
[2950123.798170] end_request: I/O error, dev xvda, sector 12894512
[2950123.798170] end_request: I/O error, dev xvda, sector 12875536
[2950123.798170] end_request: I/O error, dev xvda, sector 511456
[2950123.798170] end_request: I/O error, dev xvda, sector 13403944
[2950123.798170] end_request: I/O error, dev xvda, sector 515968
[2950124.114201] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000007
[2950124.114201] 
[2950124.118093] CPU: 0 PID: 1 Comm: init Not tainted 3.14.35-28.38.amzn1.x86_64 #1
[2950124.118093] Hardware name: Xen HVM domU, BIOS 4.2.amazon 05/06/2015
[2950124.118093]  ffff88003d578ae0 ffff88003da2bc80 ffffffff814867ca ffffffff81788cf0
[2950124.118093]  ffff88003da2bcf8 ffffffff814825ab ffffffff00000010 ffff88003da2bd08
[2950124.118093]  ffff88003da2bca8 ffffffff81c9af20 0000000000000007 ffff88003da30480
[2950124.118093] Call Trace:
[2950124.118093]  [<ffffffff814867ca>] dump_stack+0x45/0x56
[2950124.118093]  [<ffffffff814825ab>] panic+0xc8/0x1cd
[2950124.118093]  [<ffffffff8105ffd1>] do_exit+0xa41/0xa50
[2950124.118093]  [<ffffffff8106005f>] do_group_exit+0x3f/0xa0
[2950124.118093]  [<ffffffff8106f707>] get_signal_to_deliver+0x1c7/0x6e0
[2950124.118093]  [<ffffffff81014458>] do_signal+0x48/0x6f0
[2950124.118093]  [<ffffffff811e7c38>] ? fsnotify+0x228/0x2f0
[2950124.118093]  [<ffffffff81014b68>] do_notify_resume+0x68/0x90
[2950124.118093]  [<ffffffff8148d822>] retint_signal+0x48/0x86

推荐答案

您应该设计失败的解决方案.失败是不可避免的,但是aws提供了解决问题的所有服务.

You should be designing your solution to fail. Failure is inevitable, but aws provides all the services to deal with the problem.

在自动伸缩组中设置您的ec2实例,并创建/设置运行状况检查,AWS可使用该检查来确定您的实例是否运行正常.

Setup your ec2 instance in an autoscaling group, and create/setup a health check that AWS can use to determine if you instance is running OK or not.

如果设置正确,当AWS看到您的实例发生故障/失败时,它将自动用另一个实例替换您的实例.

If you set it up correctly, when AWS sees that you instance is failing/failed, it will replace your instance automatically with another.

这将需要您自己进行工作以正确地构造事物,但是您不再需要担心监视/检查实例并在出现问题时旋转一个新实例.

This will require work on your part to architect things correctly, but then you are no longer going to have to worry about watching/checking ou instance and spinning up a new one when something goes wrong.

http://docs.aws.amazon.com/AutoScaling/Latest/DeveloperGuide/WhatIsAutoScaling.html

不要将您的EC2实例视为普通的托管服务提供商程序包,即您购买并放置了解决方案的程序包,只是希望它永远运行.如果那是您的计划,那么最好与常规的托管服务提供商合作-他们将通过为您管理基础硬件/软件来确保您的网站永远运行.

Don't treat your EC2 instance like a normal hosting provider package, i.e. one you buy and put your solution it and just expect it to run as is forever. If thats your plan, then you are better of going with a regular hosting provider - and they will take care of making sure you website runs forever by managing the underlying hardware/software for you.

如果您要使用AWS,请利用他们的平台.

If you are going to be on AWS, take advantage of their platform.

对于您的特定问题,我倾向于想到内存泄漏-症状听起来不错,您可以重新开始运行一次,每次运行几天/几周,然后崩溃.

As to your specific problem, I would tend to think of a memory leak - the symptons sound right, you start fresh it runs for days/weeks at a time, and then crashes.

这篇关于AWS EC2 t2.micro实例非常不稳定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆