Deploying multiple applications to a single environment?

Marco Ceppi marco at ondina.co
Mon Nov 12 22:33:39 UTC 2012


No, but yes. In the current py-juju and go-juju projects it's not
possible. It's an item on the roadmap for go-juju and will likely exist
as a core feature eventually. There is however a way to achieve this
now, but it's really more of a workaround/prototype to how it could be
done rather than an actual solution. It exists as a part of the
juju-jitsu side project in the form of the "deploy-to" subcommand. To my
knowledge it's not really documented anywhere as juju-jitsu project a
project to gather external tools for working with Juju, things like
visualizations, integration with other system management tools, and
helper commands that do not belong in juju core or are in a prototype
state and not ready for juju core. Here's the output from the --help
command:

usage: deploy-to [-h] [--environment ENVIRONMENT] [--repository REPOSITORY]
                 [--config CONFIG]
                 machine charm [service_name]

I don't recommend using this in production, as there are known problems
with this method. One such issues is caused when deploying things to the
same machine to rapidly in succession, which will cause locking issues
with dpkg.

Thanks,
Marco Ceppi

On 11/12/2012 04:56 PM, Marcos Barbosa wrote:
> And I can put all worpress stack in a ec2 instance and limesurvey
> stack in another ec2 instance?
>
>
> 2012/11/12 Marco Ceppi <marco at ondina.co <mailto:marco at ondina.co>>
>
>     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,
>     >
>
>
>     --
>     Juju mailing list
>     Juju at lists.ubuntu.com <mailto:Juju at lists.ubuntu.com>
>     Modify settings or unsubscribe at:
>     https://lists.ubuntu.com/mailman/listinfo/juju
>
>
>
>
> -- 
> Marcos Barbosa <marcosestevesbarbosa at gmail.com
> <mailto:marcosestevesbarbosa at gmail.com>>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju/attachments/20121112/7157c673/attachment-0001.html>


More information about the Juju mailing list