简体   繁体   English

Amazon EC2意外停止工作

[英]Amazon EC2 stops working unexpectedly

I am facing a problem that is burning my brain. 我面临着一个使我心烦的问题。 I have an amazon ec2 instance that runs Linux AMI, I installed tomcat7 and I am deploying my webservice in it. 我有一个运行Linux AMI的Amazon ec2实例,我安装了tomcat7,并且正在其中部署Web服务。 This webservice connects itself with an amazon RDS instance where I have my mysql (that I use to validate user and password). 此Web服务将其自身与一个具有我的mysql(用于验证用户和密码)的Amazon RDS实例连接。 When I start my tomcat7 service everything works great, after one hour I can't log in into my system. 当我启动tomcat7服务时,一切正常,一小时后,我无法登录系统。

If i restart the tomcat7 service, everything works again. 如果我重新启动tomcat7服务,一切都会再次正常。 But why? 但为什么?

I really don't know where is the problem. 我真的不知道问题出在哪里。 I can connect to my database directly from my project in eclipse, and via command line. 我可以直接在Eclipse中通过命令行从项目连接到数据库。

I don't know why if I restart the service, my webservice works again. 我不知道为什么如果我重新启动服务,我的Web服务又可以工作了。 I know that the service hasn't stoped, because I can access the login page of my webapp. 我知道该服务尚未停止,因为我可以访问我的Web应用程序的登录页面。

I really appreciate any kind of help, 我真的很感谢任何帮助,

Rodrigo Araujo. 罗德里戈·阿劳霍(Rodrigo Araujo)。

ps: Last week, everything was working just fine. ps:上周,一切工作正常。

I've seen such behavior before, it is probably tomcat and not ec2. 我以前见过这种行为,可能是tomcat,而不是ec2。 Check the following: 检查以下内容:

1- Your threading configuration (maxThreads and acceptCount). 1-您的线程配置(maxThreads和acceptCount)。 I've seen this behavior using the blocking connector when currentThreadsBusy > maxThreads. 当currentThreadsBusy> maxThreads时,我已经使用阻塞连接器看到了此行为。 Check that you have enough threads or use the non-blocking (nio) connector. 检查是否有足够的线程或使用非阻塞(nio)连接器。

2- Check that your connection pool can reconnect lost connections automatically (autoReconnect=true in the jdbc url), your threads might be waiting db io on lost connections. 2-检查连接池是否可以自动重新连接丢失的连接(jdbc url中的autoReconnect = true),您的线程可能正在等待丢失的连接的数据库。

Anyway, your ec2 instance is probably still working... 无论如何,您的ec2实例可能仍在工作...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM