I’ve long been intrigued by OpenSift’s automatic scaling option. Unfortunately, it was out of my reach until Postgres support for scaling was introduced in a recent update. With the path mostly clear (cron is still unavailable unfortunately) I decided to give it a whirl.
Nothing I’ve read has given the impression that I could simply modify the current application using rhc to take advantage of scaling so i made a new scaled application.
rhc app create -a MyApp -t jbossas-7 -s
The “-s” flag tells the broker to create a scaled application. The configuration here is a bit different as rather than a public facing jboss cartridge you instead have haproxy sending requests to however many workers crankcase decides that it needs to have spooled up.
Now the part I was dreading. A new application template to pull from OpenShift and migrate my code in to. Expecting disaster, I added my original repository as a remote in the new one, performed a git fetch operation into the new application template, and merged the master branch. Aside from a few easy conflicts in my index page, readme, and jboss configuration (my original app predated Java 7 compatibility) the merge operation was successful and I was glad to be able to keep my original code base with history. Seriously, git is a phenomenal tool.
Similarly, OpenShift brought it to the party and picked up where git left off. I pushed to my new repository and it worked. I was expecting kinks with the JNDI since the Postgres support in scaling was brand new. Nope, everything works.