为 Web 应用程序创建外部监控
我工作的公司构建并托管了一个供客户使用的网络应用程序,我有兴趣创建某种外部监控页面(类似于 trust.salesforce.com),用户可以通过该页面查看我们服务器的当前状态/应用程序。我知道有大量不同的“监控”服务,但我想自己创建该服务,以实现完全的控制和定制。显然,该服务必须托管在与应用程序本身不同的位置和数据中心。我担心的一件事是,如果我只是在不同的位置选择不同的主机,如果该主机因任何原因(电源故障、服务器故障,甚至 ISP 故障)而停机,则监控软件也会停机。因此,我正在考虑在亚马逊 EC2 实例上托管监控应用程序。凭借其弹性 IP 功能,如果由于某种原因,数据中心或实例运行点发生故障,我可以使用相同的数据(但在不同的位置)创建一个重复实例,并且一切仍然可以正常工作。
这听起来是一个可行的计划吗?为了提高安全性,我正在考虑在不同位置创建 2 个实例并从两个实例进行监控。如果一个实例失败,另一个实例仍然可以运行。显然,一个实例必须充当监控页面的实际 Web 主机。如果一个实例检测到另一个实例因任何原因发生故障,是否可以以编程方式将弹性 IP 切换到自身?
我知道这个问题涉及很多不同的事情,我只是在寻找有关其中任何一个的反馈...
如果您已经做到了这一点,感谢您花时间阅读本文!
The company I work for built and hosts a web app used by our customers and I am interested in creating some kind of external monitoring page (similar to trust.salesforce.com) that users can go to to see the current state of our servers/app. I know there are tons of different 'monitoring' services out there but I want to create the service myself, to have complete control and customization. Obviously, the service would have to be hosted in a different location and data center than the app itself. One thing I am concerned about is that if I just choose a different host in a different location, if that host goes down for any reason (power failure, server failure, or even ISP failure) the monitoring software is down. For this reason, I am thinking of hosting the monitoring app on an amazon EC2 instance. With their elastic IP feature, if for some reason the data center or point where the instance is running fails, I can just create a duplicate instance with the same data (but in a different location) and everything would work fine still.
Does this sound like a feasible plan? For even more security, I was thinking of creating 2 instances in different locations and monitoring from both of them. If one instance fails, the other would still be up. Obviously, one instance has to act as the actual web host for the monitoring page. Is it possible programatically for one instance to switch the elastic IP over to itself if it detects the other instance has failed for any reason?
I know there's a lot of different things involved in this question, I'm just looking for feedback regarding ANY of it...
If you've made it this far, thanks for taking the time to read this!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你所说的是一个复杂问题的复杂解决方案。我认为您使用 Amazon EC2 之类的东西来减少监控应用程序崩溃的机会是正确的。此外,您可以自己开发它,但是有很多免费的监控解决方案,例如 Nagios,它可以完成您所要求的一切,并且具有高度可扩展性,因此您可以花时间让它看起来和感觉像您想要的,同时离开经过尝试和测试的软件的幕后更复杂的部分。最糟糕的事情是您的软件中存在错误,当某些软件实际上已关闭时,该错误却显示为正常运行。根据你所说的事情,我认为这将是一个大问题。
What you are talking about is a complicated solution for a complicated issue. I think you are on the right track with using something like Amazon's EC2 to reduce the chance of your monitoring app of going down. Also, you could develop it yourself but there are a great deal of free monitoring solutions out there like Nagios that will do everything you are asking for and is highly extensible so you can spend your time making it look and feel like you want while leaving the more complicated portions under the hood to software that is tried and tested. The worst thing would be for you to have a bug in your software that shows something as up when it is actually down. Based off of what you are talking about doing, I would assume that would be a huge issue.
不要使用仅分配给一个实例的弹性 IP,请考虑使用弹性负载均衡器 http://然后,aws.amazon.com/elasticloadbalancing/ 可以在任何可用区中的实例上进行路由。这样,如果实例由于某种原因变得不可用,AWS 可以管理将实例移入/移出池,并且您无需花时间“移动”弹性 IP。然后就可以轻松地将监控 cname 分配给 ELB 主机名。
我认为 RandomBen 在您的实例上使用 Nagios 的想法是一个很好的想法,因为这样您就不必在 Nagios 中重新创建所有功能。然后,您花费开发时间来设置系统并根据您的需求自定义外观。
此外,如果您可以使用 MySQL,则应考虑使用 RDS http://aws.amazon.com/rds/ 不过,如果您有一个区域之外的服务器访问另一个区域的 RDS,则需要支付传输费用。
Instead of using an elastic ip - which is only assigned to one instance, consider using the Elastic Load Balancer http://aws.amazon.com/elasticloadbalancing/ which then can route over instances in any of the availability zones. This way AWS manages taking instances in/out of the pool if they become unavailable for some reason and you do not have to spend time 'moving' the Elastic IP around. It is then easy to assign your monitoring cname to the ELB hostname.
I think RandomBen's idea of using Nagios on your instances is a good one because then you do not have to recreate all the functionality in Nagios. You then spend development time setting up the system and customizing the look and feel to your needs.
Also, if you can use MySQL, you should consider using RDS http://aws.amazon.com/rds/ although you will need to pay transfer fees if you have servers outside of a region accessing the RDS in another region.