Reputation: 909
I have a Tomcat 7 instance in Dogado Jelastic cloud (Jelastic platform version is 2.5.2). As well I have a Bamboo, which deploys everynight two applications on this Tomcat 7 instance. Due to some problems in applications I have memory leaks, which break the apps after some time. So I want to restart the server periodically to fix this problem (I know it's not good fix, but that's enough for now). I found a few ways to restart the Tomcat 7 automatically:
So I have two questions:
Thanks!
Upvotes: 0
Views: 687
Reputation: 395
Just add this command to the cron/tomcat via dashboard config panel
0 * * * * /opt/tomcat/bin/shutdown.sh; /opt/tomcat/bin/startup.sh
It works fine for tomcat7.
Upvotes: 2
Reputation: 1528
For the cron option, you need to do this from the root user (that's why when you do it from your jelastic user via the dashboard it does not work in the expected way).
However, Dogado should be able to configure this cron for you without any issues. I recommend this as your simplest solution in this case.
The difficulty with the API restart option is you will probably need to execute that from somewhere else (e.g. not a script invoked via cron inside your environment). Unless you already have a suitable system (e.g. another environment, or a server elsewhere) that probably isn't a viable approach.
Personally I also dislike that the API requires your Jelastic username/password, so grants full access to all of your environments - even if you only want it to have permission to just one. You can potentially work around that limitation by creating a collaborator, sharing the environment with them, and treating that user as your "API user".
Upvotes: 0