简体   繁体   English

'启动更像这样的'AWS EC2实例

[英]'Launch More like this' AWS EC2 instance

I currently have a blog running on AWS EC2 t2.micro . 我目前在AWS EC2 t2.micro上运行了一个博客。

This t2.micro is getting out-scaled and I need a bigger instance. 这个t2.micro越来越大,我需要一个更大的实例。 I'm hosting a Wordpress blog. 我正在主持一个Wordpress博客。

Is there a way to change in to t2.medium without affecting the downtime? 有没有办法改变到t2.medium而不影响停机时间?

I was thinking about the 'Launch more like this' button. 我正在考虑'发布更像这个'按钮。 Will it launch 2 instances like I have? 它会像我一样推出2个实例吗? Where will my site be hosted then? 那么我的网站将在哪里托管?

Easiest solution: Have some downtime. 最简单的解决方案:有一些停机时间。

  • Stop the instance 停止实例
  • Change the Instance Type 更改实例类型
  • Start the instance 启动实例

Do it when usage is low and it will have minimal impact. 在使用率较低时进行,影响最小。 Only takes 1-2 minutes. 只需1-2分钟。

If a few minutes is too much downtime for you, then you should redesign the system as a Highly-Available application with multiple servers running in different Availability Zones, using a shared, multi-AZ database. 如果几分钟的停机时间太长,那么您应该使用共享的多可用区数据库将系统重新设计为具有在不同可用区中运行的多个服务器的高可用性应用程序。 If you are just running on one server, there is no guarantee of uptime . 如果您只是在一台服务器上运行,则无法保证正常运行时间

'Launch More Like This' will only help in creating a duplicate server with the same networking characteristics (security groups, volume sizing, etc.). “启动更多像这样”只会有助于创建具有相同网络特征的重复服务器(安全组,卷大小等)。 It will not be an identical clone in terms of content unless your configuration is done entirely from the User Data or Cloud Init (which will be the same when you launch using the 'Launch More Like This' button, or if you are using Ansible/Chef or some other system to configure it after the fact. When you launch more like this, you are able to change the instance type if there is a path from your current instance type to the one you want (within any family, such as t2, this is almost always possible). Otherwise, you will have to stop and start the instance to do so. 除非您的配置完全来自用户数据或Cloud Init(当您使用'Launch More Like This'按钮启动时,或者如果您使用的是Ansible /),它将在内容方面不是完全相同的克隆Chef或其他系统在事后配置它。当您启动更多这样的事件时,如果存在从当前实例类型到您想要的路径(在任何系列中,例如t2),您可以更改实例类型,这几乎总是可能的。)否则,您将不得不停止并启动实例。

If you're looking for high availability, you probably want to use an ELB with a Route 53 DNS record that corresponds to your website's URL backed by two instances where requests for the website can be served by either of a pair of instances. 如果您正在寻找高可用性,您可能希望使用具有Route 53 DNS记录的ELB,该记录对应于由两个实例支持的网站URL,其中两个实例中的任何一个都可以提供对网站的请求。

Think about this. 想想这个。 When you change the instance type, AWS has to choose a different physical hardware. 更改实例类型时,AWS必须选择其他物理硬件。 It may be on the same physical machine or (more likely) another physical machine. 它可能在同一台物理机器上,或者(更可能)在另一台物理机器上。 For this to happen, the instance has to be stopped before moving it to a new physical machine. 为此,必须在将实例移动到新物理机器之前停止实例。

There is no concept of live motion like VMWare in AWS. AWS中没有类似VMWare的实时动作概念。 Your instance has to be stopped before you can change its size. 必须先停止实例,然后才能更改其大小。

Launch more like this will create another machine just like the current one. Launch more like this将创建另一台机器,就像当前的机器一样。 If you have an elastic IP attached, there will be a few seconds of downtime when you re-associate the elastic IP, but the new machine will be a clone of the old machine with a different private IP. 如果您连接了弹性IP,则在重新关联弹性IP时会有几秒钟的停机时间,但新计算机将是具有不同专用IP的旧计算机的克隆。

For 'Launch more like this' button: If you use launch more like this button , the storage device will be changed and the data stored on it will be erased. 对于“更多像这样启动”按钮:如果您使用启动更像这个按钮,存储设备将被更改,存储在其上的数据将被删除。 so it will be new instance. 所以这将是新的实例。 you can not see your wordpress blog. 你看不到你的wordpress博客。

Solution: Just create the AMI Image from your running instance and you should not click no reboot option(why because you may get errors while launching or after launching the new instance from the newly created image). 解决方案:只需从正在运行的实例创建AMI映像,就不应该单击“无重启”选项(为什么在启动时或从新创建的映像启动新实例后可能会出现错误)。 After creating an image and launch with the type t2.medium and run the start the web server inside the instance then repoint your newly created instance ip to your DNS server. 在创建映像并使用类型t2.medium启动并运行实例内的Web服务器后,将新创建的实例ip重新指向DNS服务器。

Hopefully you will see your website at "new-instance-public-ip" 希望您能在“new-instance-public-ip”中看到您的网站

您可以创建一个新的EC2,在其上安装博客并使用Route 53附加固定IP,之后您可以将您的域附加到新IP,然后您可以终止微EC2。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM