I have Java Liberty Web Application on Bluemix. If I need to update it, the app becomes unavailable for a few minutes. Is it possible to update it without turning it off? For example deploy two applications and reroute to a second one one when first is being updated?
2 Answers
Yep. There best way of doing this currently is via the following steps.
- deploy original application on myroute.mybluemix.net
- make some code changes
- deploy changed application on myroute2.mybluemix.net
- map myroute.mybluemix.net to the changed application using
cf map-route APP_NAME DOMAIN [-n HOSTNAME]
. Original application now has myroute.mybluemix.net and the changed application now has myroute.mybluemix.net & myroute2.mybluemix.net. At this point traffic will be routed equally between the two application versions (assuming they have the same number of instances). - unmap myroute.mybluemix.net from the original application using
cf unmap-route APP_NAME DOMAIN [-n HOSTNAME]
. All traffic on myroute.mybluemix.net will now all be routed to the newer version. - delete original application using
cf delete APP_NAME
- (optional) remove myroute2.mybluemix.net using
cf unmap-route APP_NAME DOMAIN [-n HOSTNAME]
This seems a bit long winded but it will achieve what you want.

- 931
- 1
- 7
- 22
This is known as a blue-green deployment, and there are several cloud foundry plugins which will do it 'automatically':
Bluemix's Active Deploy service
This is new function, so it's in beta at the moment. To make the service available, you can add it from the Bluemix service catalog to your space. If you're running cf locally, you'll need to install the plugin:
cf add-plugin-repo bluemix http://plugins.ng.bluemix.net/
cf install-plugin active-deploy -r bluemix
Once it's available (either with a cf plugin install, or the catalog configuration), and you have routes, you can do
cf push --no-route new-version
cf active-deploy-create old-version new-version
Cloud Foundry community-contributed plugin for blue green deployments
You can install this using cf add-plugin-repo garage https://garage-cf-plugins.eu-gb.mybluemix.net/ cf install-plugin blue-green-deploy -r garage
Then, to push,
cf blue-green-deploy app_name --smoke-test <path to test script>
The smoke test part is optional, but a good idea.

- 10,767
- 3
- 23
- 25