Deploying multiple applications to a single environment?

Marco Ceppi marco at ondina.co
Mon Nov 12 21:42:42 UTC 2012


The answer is yes. So there's several ways to tackle this within the
scope of Juju. You can deploy multiple "application stacks" to a single
environment and still have them separated, while it's not necessary, if
a requirement was to have a loadbalancer, WordPress, and MySQL separated
from another loadbalancer, Limesurvey, and MySQL server you could do
that in the same environment like so:

juju deploy <loadbalancer> wp-lb
juju deploy <loadbalancer> lime-lb
// Where loadbalancer is something like squid, haproxy, varnish, etc [1]
juju deploy wordpress
juju deploy limesurvey
juju deploy mysql wp-mysql
juju deploy mysql lime-mysql

Since you can provide aliases to services in Juju enironments you can
deploy one charm multiple times under different names. Now you can
continue with the set up as you normally would, only using aliases:

juju add-relation wp-lb wordpress
juju add-relation wordpress wp-mysql
juju expose wp-lb

juju add-relation limesurvey lime-lb
juju add-relation limesurvey lime-mysql
juju expose lime-lb

Now you have two application stacks in the same environment but still
separated from each other. You can mix and match this as you see if,
adding a relation from MySQL to multiple services is fine (and expected
in the charm) MySQL will simply create a database per service connected.

I like to think of environments as levels of access for people. So if
you have one team that needs access to a certain stack of applications
I'd create that environment for them, whereas another team might need
access to different stacks, so they'd just be deploying to a different
environment to manage their stacks. There's really no problem with
deploying arbitrary services in an environment whether they're related
to each other or not it makes no difference to juju.

Thanks,
Marco Ceppi

[1]: http://jujucharms.com/interfaces/http

On 11/12/2012 04:20 PM, Darryl Weaver wrote:
> Hi All,
>
> So, here is an interesting question about deploying multiple
> applications.  This is a question about best practises.
>
> Say, I am a system administrator who wants to deploy many similar web
> applications.  But I want each one to have it's own environment on
> different servers and all deployed using Juju, for performance, security
> and DR reasons.
>
> So, for example, I would like to have a wordpress app node and mysql
> database node (for wordpress only) and a load balancer (for wordpress
> only), but I also want to have another application, such as limesurvey
> app, db server and load balancer.
>
> So, do I create multiple environments to contain each of my applications
> or do I deploy to the same environment?
>
> If I am deploying to the same environment, how do I specify separation
> between applications and relationships between specific instances?
>
> Thanks in advance for any advice,
>




More information about the Juju mailing list