测试AWS弹性魔豆缩放 [英] Testing AWS Elastic Beanstalk scaling

查看:119
本文介绍了测试AWS弹性魔豆缩放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设置了弹性青苗的服务器。在需要时,它应该是实例的数量增加从1到最多4。我有一个鬼鬼祟祟的怀疑,但是,当它开始一个新的实例,该实例不会被正确配置,因为我无法安装的没有ssh'ing到实例,并手动设置它,按<一个MySQL模块为Python href="http://stackoverflow.com/questions/16621726/getting-peewee-to-work-on-elastic-beanstalk/16745255#comment32865467_16745255">this问题。

I've set up a server in elastic beanstalk. When required, it is supposed to increase the number of instances from 1 to up to 4. I have a sneaking suspicion, however, that when it starts a new instance that instance won't be properly configured, because I was unable to install the mySQL module for Python without ssh'ing into the instance and setting it up manually, as per this question.

所以,我的第一个问题是什么是测试弹性魔豆是正确缩放的最佳方法?如果新的实例启动时,我怎么能肯定的是我看到的新的,而不是原来的,手动配置一一?

So my first question is what is the best way to test that Elastic Beanstalk is scaling correctly? If new instances are started up, how can I be sure that I'm seeing one of the new ones rather than the original, manually configured one?

我的第二个问题是,如果这是一个问题,就像我怀疑,我怎么能解决这个问题?可以在需要的时候我克隆我的工作实例,并成功启动复制它们?我将如何做呢?

My second question is that if this is a problem like I suspect, how can I fix it? Can I "clone" my working instance and start successfully duplicate them when required? How would I do that?

非常感谢,亚历克斯

更新:后,从小丑的非常有用的建议,我已将此添加 myapp.config 文件:

Update: After the very helpful advice from joker, I added this to the myapp.config file:

container_commands:
    install_MySQL-python:
        command: /opt/python/run/venv/bin/easy_install MySQL-Python==1.2.3

正如你所看到的,我是有问题的是,MySQL的,Python的不正确使用 PIP 安装,我不得不使用的easy_install 。这意味着它无法通过用于所有其他蟒蛇依赖性 requirements.txt 文件来安装。随着加入以上命令放入配置文件在我的 .ebextensions 文件夹,这是当实例启动,我没有ssh到每个单独的实例来完成。

As you can see, the problem I was having was that MySQL-Python wouldn't install correctly with pip, I had to use easy_install. This means it couldn't be installed through the requirements.txt file that is used for all the other python dependencies. With the added commands above put into the config file in my .ebextensions folder, this is done when the instance is initiated and I don't have to ssh into each individual instance.

作为一个方面说明,你的的有包括命令在上面的命令,即使是通过SSH实现相同的时候做的。其实我是有在那里的第一,也没有工作。

As a side note, you don't have to include "sudo" in the command above, even though you do when achieving the same through ssh. In fact I had it in there at first and it didn't work.

非常感谢小丑。

推荐答案

亚历克斯,

我觉得你的怀疑是正确的。你所做的任何配置更改到正在运行的EC2实例不会自动出现在新的实例。

I think your suspicion is correct. Any configuration changes you make to your running EC2 instance will not automatically appear on new instances.

在你的第一个问题:

要测试你的系统是如何工作的在多服务器环境中最简单的方法,可能是改变参数最小实例数中的配置部分的自动缩放部分弹性魔豆AWS控制台。设置此参数,例如,2。

The easiest way to test how your system works in a multi-server environment, is probably to change the parameter Minimum instance count in the Autoscaling part of the Configuration section of the Elastic Beanstalk AWS Console. Set this parameter to, for instance, 2.

(另一种方式,看看新的服务器已启动,简直就是杀死你当前的EC2实例。只要选择你的运行实例的操作停止,负载平衡器应发现这一点,并自动配置为你一个新的实例,一旦健康状况从绿色转变为红色。)

(Another way to see how new servers are started, is simply to kill your current EC2 instance. Just select the action Stop on your running instance. The load balancer should detect this, and automatically deploy a new instance for you once the health has transitioned from GREEN to RED.)

和第二个问题:

解决这个问题最好的办法就是自定义您的AWS EB环境。创建一个的.config 文件来设置需要的库,并进行配置更改到新的实例。

Your best bet around the problem is to customize your AWS EB environment. Create a .config file to set up required libraries and perform configuration changes to your new instances.

祝你好运!

这篇关于测试AWS弹性魔豆缩放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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