Yesterday, we had a guest post from Mr. Sander de Vos from Belgium. Today we have another short article from Leo, over in the Philippines. This is a repost of the article that Leo wrote for his blog. You can read it here, on Dzone (go upvote it!) or on his blog.
If you have an existing Play! application and you want to put it on Jelastic, the easiest way is to use the Jelastic Plugin on Play!
- You need to have an existing Jelastic Environment. If you’re Play! application used a database, your environment must have database enabled and also configured, which means you have your database create with appropriate user assigned to it
- Your application must use at least Play! version 1.2.x.
- On your application.conf add this Jelastic configuration
Jelastic.api.login and password are your credentials to log onto the Jelastic App Controller. Jelastic.api.context specifies where the application will be deployed. In the example, ROOT means it is deployed and accessible by the domain name which is aims-jam.jelastic.servint.net. If I put an app on jelastic.api.context, my application will be deployed on app context and can be accessed on aims-jam.jelastic.servint.net/app. Jelastic.api.environment is the name of your environment defined on your apihoster.
At the moment, jelastic.api.apihoster you can get from this table.
- Configure your jdbc on application.conf.
You can edit and define this within the Jelastic admin console.
- Increase your db.pool.timeout to 10000ms of application.conf
- Deploy your application to jelastic cloud by (must be on the application directory): play jelastic:deploy
This won’t take long, but it does depend on your internet connection speed. This will compile your application and create a war file and then will upload it to jelastic. If it is finish, you can now access your application. In my example, I can access my application on aims-jam.jelastic.servint.net.
It seems that the Jelastic plugin can only work the default environment specified on application.conf, so I created a new environment that I named localhost for my localhost testing environment.
If I am testing my application locally, I will execute: play run –%localhost
Hope this can help you.