about

Ease of OpenShift - 12 May 2012

search

I originally heard of Red Hat's OpenShift Platform as a Service from CHRIS WONG's DEVELOPMENT BLOG. He did not go into great detail about OpenShift, and I first played around with Jelastic back when they were in beta. Unfortunately I would have to pay ~$30/month for running my JSP/Servlets/JDBC web app on Jelastic's PaaS at close to minimum traffic levels. If you want to control all your scaling via a sexy in-browser UI then look no further to Jelastic. But if I was going to pay $30/month, why not pay $40/month and get my own colocated 1U?

To set up the OpenShift PaaS for running a standard MySQL powered Java web app:

  1. Sign up for an account. Duh. The automated system should email you in a few minutes.
  2. Log in and head over to the Create a New Application tab.
  3. I opted to go for the JBoss Application Server 7.1 app type, did not want to spend the time on the Do-It-Yourself option.
  4. Name the app and hit Create Application.
  5. Add the mysql-5.1 cartridge. I also added the phpmyadmin-3.4 cartridge cause I am a sucker for that sort of thang.
  6. Emails should be sent to you for the mysql instance and phpmyadmin auth.
  7. Clone your app's git repo so you can add your app code in. I chose to delete everything except the .openshift and deployments directories because I would much prefer building and sticking a ROOT.war in the deployments directory than having a second source tree to keep up to date. There are ways to automate this, but I only use OpenShift to host production code.
  8. Push your new J2EE app live by pushing to the remote end. It is a work-flow that I think is reasonably slick at this point.

The only thing that I could not accomplish from the web panel or Git was adding an alias; so I could use somehost.cooldomain.ext.

The official command is rhc app add-alias -l [email@alias.com] -a [app name] --alias mycool.alias.com. But on the Mac OS X machine I was using, I ran the setup of the gems locally. So it looked more like cd ~/.gem/ruby/1.8/bin; ./rhc-app add-alias -l [email@alias.com] -a [app name] --alias mycool.alias.com. Don't forget to update your domain's authoritative DNS servers.

According to a Red Hat representative I emailed:

I know it's hard to believe but we plan to keep today's 3 free gears under the free tier when we introduce a paid plan later this year. Right now it's a wip and I've attached our current plan to this email PDF, appreciate your feedback.

Regarding scaling & costs, we have a feature in our roadmap that will allow users to set thresholds for their applications both on min/max gears in the application and cost. That should help you to scale without blowing your budget.

TL;DR check out OpenShift for great JBoss hosting (among other things)


490 words. Post tags: OpenShift, Red Hat, and J2EE.

Post content is written by Jason Zerbe and licensed CC BY-NC 3.0.