确保 tomcat 和 WebApp 均已成功启动
是否可以确定 Tomcat 是否已成功启动并且部署到它的所有 Web 应用程序也已成功启动?
当然我可以抓取Tomcat的日志文件,但是有更简单的方法吗?
我需要能够以编程方式监视 tomcat,因为我需要启动大约 15 个 Tomcat(它们可以串行启动)。我不怕编写 bash 脚本并监视每个日志的输出以查找成功消息或任何错误消息,但肯定有更优雅的方法吗?
Is it possible to determine if a Tomcat has started successfully AND all of the webapps deployed to it have also started successfully?
Of course I can trawl the Tomcat's log file, but is there an easier way?
I need to be able to monitor the tomcat programmatically, since I need to start about 15 Tomcats (they can be started in serial). I'm not afraid to write a bash script and monitor the output of each log looking for the success message or any error messages, but surely there's a more elegant way?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确保服务启动并运行的最准确方法是通过客户端访问该服务。
对于 Tomkat 上的 WebApps,最好的方法是使用 cron 作业来访问每个应用程序的某些页面,以指示应用程序的状态(运行、关闭等)。
我说这是最好的方法有很多原因:
The most accurate way to ensure a service is up and running is to hit that service with a client.
In the case of WebApps on Tomkat, a cron job that hits some page of each app that indicates the application's status (up, down, etc.) is the best way to do this.
I say it's the best way for a number of reasons: