我需要帮助复制亚马逊的AWS EC2实例 [英] I need help duplicating Amazon AWS EC2 instances

查看:2156
本文介绍了我需要帮助复制亚马逊的AWS EC2实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始使用AWS EC2和不完全确定我理解这一点。

I'm just getting started with AWS EC2 and not entirely sure I understand it.

从我读过,一个实例基本上是一个虚拟服务器,你应该能够以某种方式从AWS控制台复制的虚拟服务器莫名其妙。然后,使用负载均衡器或弹性IP将请求路由到一个或另一个。

From what I've read, an instance is basically a virtual server, and you should be able to somehow "duplicate" that virtual server from the AWS console somehow. Then use Load Balancer or Elastic IP to route requests to one or the other.

在问题出现的时候,我试图复制我的实例。我想一个亿的事情,但是这让我唯一接近是创造我当前实例的AMI,然后启动从一个实例,但是当我这样做,新的实例基本上是默认的服务器配置。没有我的档案在那里。

The problem comes in when I try to "duplicate" my instance. I tried a million things, but the only thing that got me close was creating an AMI of my current instance then launching an instance from that, but when I did that, the new instance was basically the default server config. None of my files were there.

我是什么做错了吗?

推荐答案

您真的不重复的实例。你更复制它作为一个蓝图。然后,当你一个实例后启动,您可以基地起飞的快照或蓝图的该实例。

You don't really "duplicate" the instance. You more copy it as a "blueprint". Then when you boot an instance later, you can base that instance off of your snapshot or "blueprint".

该ELB可以被配置为指向你想要的任何实例,因此,当你启动一个新的服务器关闭此快照/蓝图,可以自动添加到ELB。

The ELB can be configured to point at any instance you want, so when you boot a new server off this snapshot/"blueprint" it can be automatically added to the ELB.

现在正在清理,回答这样的问题:

Now that is cleared up, to answer the question:

  1. 我会确保使用EBS支持的实例。你可以找到他们全部结束。但是,并非S3支持。如果EBS支持的,然后用您的所有的configs的确切数量将在那里。

  1. I would make sure to use EBS backed instances. You can find them all over. But not S3 backed. If they EBS backed then the exact volume with all your configs will be there.

我会确保您的实例配置你喜欢它,并安装了引导时进行适当的脚本。你会希望你的服务开始,配置文件从拉下来库等。配置文件应该在那里,但我不会依赖于这一点。如果你有他们在一个库中,然后使启动脚本拉下来,并复制它们,你想要的,你会好得多。

I would make sure your instance is configured how you like it and has proper scripts installed for when it boots up. You will want your services started, config files pulled down from repositories, etc. The config files should be there, but I would not rely on that. If you have them in a repository and then make a startup script to pull them down and copy them where you want, you will be in much better shape.

通过实例运行,并选定后,点击该实例的操作下拉,然后单击创建AMI

With the instance running and selected, click on the instance actions drop down and click "Create AMI"

该实例将重新启动。所以要小心。

The instance will REBOOT. So be careful.

启动一个新的实例。并挑选AMI /快照#3中创建。

Launch a new instance. And pick the AMI/Snapshot that #3 created.

完成。勾选此 http://stackoverflow.com/a/8919031/667608 ,可以帮助上述。

Done. Check this http://stackoverflow.com/a/8919031/667608 that could help with the above.

呵呵,一件事,如果您有任何EBS卷连接,它们也将被复制,但您将需要安装它们一旦服务器启动。

Oh, one other thing, if you have any EBS Volumes attached, they will also be copied, but you will need to mount them once the server boots.

这篇关于我需要帮助复制亚马逊的AWS EC2实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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