如何在现场/生产环境中监控和维护我的 Grails 应用程序?
这是我第一次启动实时网站(在 Amazon EC2 平台和 Cloud Foundry 下使用 Grails Web 框架),我很快意识到我还没有准备好在生产模式下正确监控和维护我的应用程序(幸运的是该网站可以访问)仅限数量非常有限的用户)。
到目前为止我面临的问题是:
- 无法改变我的观点。我需要重新部署我的应用程序,
- 但我没有监控。我不知道谁连接了,他们什么时候登录/注销...
- 重新部署我的应用程序(上传 WAR + 部署)至少需要 30 分钟。
- 我不知道如何在不通过 Cloud Foundry 重新部署的情况下重新启动 Tomcat 服务器!
- ...
所以,我的问题很简单:
你可以推荐什么工具(包括grails插件)和方法让我摆脱困境我目前失明?
It is the first time I have ever launched live a website (with Grails web framework under Amazon EC2 platform and Cloud Foundry) and I realized quickly that I am not ready for monitoring and maintening correctly my application in production mode (fortunately the website is accessible to a very limited number of users) .
The issues I have faced so far are:
- Cannot change my views. I need to redeploy my application
- I have no monitoring. I don't know who is connected, when do they sign in / sign out...
- Redploying my application (upload WAR + deploy) takes at least 30 minutes.
- I don't know how to restart my Tomcat server without a redeploy through Cloud Foundry !
- ...
So, my question is very simple:
What tools (including grails plugins) and methods can you recommend me for taking me out from my current blindness?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我不确定这有多大帮助,但是我使用 JavaMelody Grails 插件(http://www.grails.org/plugin/grails-melody)在关闭服务之前,我用它来查看该网站是否正在被使用。
希望有帮助。
I am not sure how much this will help, however I use the JavaMelody Grails Plugin(http://www.grails.org/plugin/grails-melody) I use it to see if the site is being used before I pull down the service.
Hope that helps.
我在早期尝试过 Cloud Foundry,发现它有点粗糙。听起来情况仍然如此,部署超过 30 分钟并且无法重新启动 Tomcat 服务器。如果您创建自己的 EC2 实例、安装 tomcat 并管理自己的部署,那么一半的问题就可以解决。这将让您通过 shell 访问弹起 tomcat:
并重新部署您的应用程序
,或者您可以通过 tomcat 管理控制台来完成此操作,但我发现它很不稳定。
关于监控,有几种方法可以做到这一点。最简单的方法是向您的系统添加 CloudWatch 监控。这将使您更深入地了解应用程序的性能。
要更详细地监控谁连接到您的应用,我建议您查看 Google Analytics 或 < a href="http://haveamint.com/" rel="nofollow noreferrer">薄荷。如果您需要超越这一点(通过每个用户监控),您可能必须滚动自己的日志记录/跟踪以满足您的需求。还有其他类似 Google Analytics 和 Mint 的付费软件包可供您集成,但我不能说哪个最适合您的需求。
I tried Cloud Foundry in it's early days and found it a little rough. Sounds like that's still the case with 30+ minute deploys and the inability to restart your tomcat server. Half of your problems could be solved if you just created your own EC2 instance, installed tomcat and managed your own deployments. That'll let you bounce tomcat through shell access:
and redeploy your app
or else you could do it through the tomcat admin console, but I find it to be flaky.
Regarding monitoring, there are a couple of ways you can do that. The easiest is to add CloudWatch monitoring to your system. That'll give you more insight into the performance of the application.
For more detailed monitoring regarding who's connecting to your app, I'd suggest looking at Google Analytics or Mint. If you need to get beyond that (with per user monitoring), you'll likely have to roll your own logging/tracking for what meets your needs. There are also other paid packages out there along the lines of Google Analytics and Mint that you can integrate with, but what fits your needs best, I can't say.
对于已部署系统的实际监控,您还可以使用 Hiperic HQ。它是来自 Spring Source 的监控解决方案,Spring Source 也是 Grails Framework 的所有者。
它可以根据您的情况进行管理:
顺便说一句,重新部署应用程序并进行更改是可以的。在生产服务器上修改正在运行的应用程序是一种非常糟糕的做法。
For actual monitoring of deployed system you can also use Hiperic HQ. It's a monitoring solution from Spring Source, who also are owners of Grails Framework.
It can manage, at your case:
btw redeploying app with changes is ok. it's a very bad practice to modify running app, on the production server.
我不知道 JMX 和 JConsole 是否可以提供帮助,但这可能是查看启用 JMX 的 POJO 状态的好方法。 Spring 使这一切变得容易。
I don't know if JMX and JConsole can help, but that might be a good way to see what the status of JMX-enabled POJOs is. Spring makes this easy to do.
您不必启动自己的 EC2 实例即可获得 shell 访问权限。从 DeploymentDetails 复制实例的公共 DNS 名称,并使用您在注册 Cloudfoundry 时输入的私钥通过 SSH 复制到该实例。示例:
ssh -i /path/to/gsg-keypair.pem root@your_instance_DNS_name
You don't have to start your own EC2 instances in order to get a shell access. Copy the public DNS name of the instance from DeploymentDetails, and SSH into it using the private key you entered when registering for Cloudfoundry. Example:
ssh -i /path/to/gsg-keypair.pem root@your_instance_DNS_name