从单个ec2实例启动自动扩展解决方案 [英] Starting an auto-scaling solution from a single ec2 instance

查看:111
本文介绍了从单个ec2实例启动自动扩展解决方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

继续

非常感谢您.一次跟进.如果我使用两个实例和一个负载均衡器,那么我如何才能使一个实例的wordpress博客在它们之间正常工作?我知道我创建了一个AMI,但是每次在wordpress上发布时,我都必须更新它吗?

Thank you very very much for this. One follow up. If I use two instances and a load balancer, how do I get what is currently my one instance wordpress blog working properly between them? I understand I create an AMI, but then do I have to update it every time I post on wordpress?

从单个EC2实例开始实施自动缩放解决方案的基本正确方法是什么?

What is a basic, correct way to start implementing an auto-scaling solution from a single EC2 instance?

推荐答案

有2个方面需要研究.

  • Wordpress数据库
  • Wordpress文件(应用程序文件,包括插件,主题等)

在哪里保存数据库?

  • 为启用自动缩放设置并确保一致性,您将 需要将数据库置于自动扩展EC2实例之外.

  • For enabling auto scaling setup and to ensure consistency, you will need to have the database outside the autoscaling EC2 instance.

如果数据库位于RDS中,那就很好了.

If the database is in RDS, then well and good.

否则,如果它在您的EC2实例中,那么我建议在自动缩放设置之外包含1个EC2实例,并将数据库保留在其中.

Else, if its within your EC2 instance, then I would suggest to have 1 EC2 instance outside auto scaling setup and keep the database inside that.

如何设置EC2 Auto Scaling?

  • 步骤1:首先从现有实例中创建一个重复的Wordpress实例(使用AMI). 这将导致2个EC2实例.实例1(原始数据库)和实例2(实例1的副本)

第2步:在实例2中,将您的Wordpress配置为指向实例1中的数据库

Step 2: In instance 2, configure your Wordpress to point to the database inside instance 1

步骤3:以实例2的AMI(将用作自动伸缩组的基本AMI)

Step 3: Take AMI of Instance 2 (This will be used as base AMI for autoscaling group)

第4步:使用在第3步中创建的AMI,创建并配置Autoscaling

Step 4: Using the AMI created in Step 3, create and configure Autoscaling

这些步骤将确保所有自动缩放实例都指向同一数据库,因此您不必在每次创建/更新内容时都更新自动缩放.

These steps will ensure that all the autoscaling instances will point to the same database and hence you dont have to update autoscaling every time you create/update the contents.

但是,每当更改用于创建/更新应用程序或wordpress安装文件的设计/插件/其他内容时,都需要更新Autoscaling组.

However, whenever you change the designs/plugins/other contents which creates/updates the application or the files of wordpress installation, you will need to update the Autoscaling group.

如果您也想摆脱这个问题,请考虑使用EFS在所有EC2实例之间具有共享卷,并配置wordpress安装以从该EFS卷开始工作.加上上述步骤,将使安装完全可自动缩放,而无需担心完全更新自动缩放设置.

If you want to get rid of this one as well, consider using EFS to have a shared volume across all EC2 instances and configure the wordpress installation to work from that EFS volume. This along with above steps will make the installation completely autoscalable without worrying about updating the autoscaling setup at all.

这篇关于从单个ec2实例启动自动扩展解决方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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