我想在 AWS 上扩展我的 EC2 实例。为此,我被建议使用 Sensu framwork .
我想根据 CPU 使用情况扩展实例。为了进行测试,我在 Windows 和 Ubuntu(V.Box) 上都配置了 Sensu,我正在 Ubuntu 上按照 this example 运行客户端。 .我的 CPU 数据成功传递到 RabbitMQ。
现在我想知道如何在 Sensu 服务器中使用这些数据,以便我可以扩展或扩展?任何建议将不胜感激。
万一重要,我会将它与 Opscode Chef 一起使用。
最佳答案
实现目标的最简单方法是将可用组件连接在一起(这仍然需要编写一些代码,请参见下文)并尽可能避免添加自定义解决方案:
Amazon EC2提供 Auto Scaling ,这又由 Metrics 驱动通过 Amazon CloudWatch 收集.所以指标在这里是关键,而这正是 Sensu都是关于,参见例如Sensu and Graphite ,其中涵盖了将指标从 Sensu 推送到 Graphite 的两种方法:
Remember: think of Sensu as the "monitoring router". While we are going to show how to push metrics to Graphite, it is just as easy to push metrics to any other system – Librato, Cube, OpenTSDB, etc. In fact, it would not be difficult at all to push metrics to multiple graphing backends in a fanout manner. [emphasis mine]
您的指标已经在 Sensu 服务器中可用,因此您现在需要将它们推送到 CloudWatch(就像上面文章中对 Graphite 的解释一样)并依次将相应的 Auto Scaling 策略附加到这些。
当前可用metrics handlers Sensu 的目标是 Graphite和 Librato确实,所以你需要实现这样一个 Sensu Handler为 Publishing Custom Metrics进入CloudWatch(一定要分享,时间久了肯定会被广泛使用:)
祝你好运!
关于amazon-ec2 - 如何使用 Sensu 框架收集的系统数据自动扩展 EC2 实例?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9904934/