Ubuntu – How to deploy multiple stacks in an environment

juju

I've deployed a haproxy->lamp->mysql stack using juju. It seemed pretty straight forward and it works well from my tests. I've also seen its easy to scale a layer and add extra units to the lamp servers for example. The rest of our configuration on the server is done by puppet.

However within the same environment "ec2" (specified in my environments.yaml) in this case, I wish to deploy another set of servers using the same formular haproxy->lamp->mysql.

However it doesnt seem possible as you get this error:

ERROR Service name 'mysql' is already in use

Is there a way to do this?

I had the idea to create separate environments in the yaml file with the same EC2 credentials but this seems like its going to spin up an extra juju config server per environment. As we are running over 250 web sites in these type of stacks that means an extra 250 servers on our AWS bill which is far from ideal.

Ideally I'm aiming to deploy multiple haproxy->lamp->mysql stacks without having to create new charms for each website.

Any suggestions welcome or if it can't be done I need to rethink things.

Best Answer

Yuu can explicitly name services in juju. So for for example instead of:

juju deploy haproxy
juju deploy mysql

you can just name them whatever you want:

juju deploy haproxy mynewproxy
juju deploy mysql dbserver2

or whatever fits your model. You just need to remember to add-relation based on name after that, so: juju add-relation mynewproxy dbserver2

It's awesome that you're using juju for this, if you want to give us some feedback on how it's working out for you please send a post to the juju mailing list.

Related Question