We're not talking about installing packages on your computer, we're talking about deploying services on a cloud.
We're not talking about installing packages on your computer, we're talking about deploying services on a cloud.
Instead of deploying a lamp server onto one machine you deploy the service you want to your datacenter. This can either be EC2, your openstack cloud, or local machines.
Let's say you want to deploy a scaleable mediawiki at work:
juju deploy haproxy
juju deploy mediawiki
juju deploy mysql
juju add-relation haproxy mediawiki
juju add-relation mysql mediawiki
And then you have a load balancer, a mediawiki instance, and a mysql instance. You point your DNS to the haproxy instance, and you're ready to go.2 months later your wiki becomes way popular. Since you're on the cloud you're totally elastic, so you can go "juju add-unit mediawiki" and you've got another mediawiki node load balancing. Or do "juju add-unit n=10 mediawiki" and have 10 nodes ready to go.
If you're on AWS, each of those deploys fires up an instance. Same on OpenStack. If you're on bare metal the Ubuntu orchestra server on your network will turn on machines and install/provision them to do the equivalent.
Like could I simply switch postgres for mysql in your example and have it work, or does mediawiki specifically need a relation to a mysql?
On the flip side, adding a relation to haproxy, additional hooks fire in each charm. Mediawiki tells haproxy the address and port it's running on and haproxy hooks take care to ensure it's in the loadbalancer configuration.
What's excellent about these relationships is as you scale mediawiki to meet demand (juju add-unit mediawiki) all of this relation data stays in tact. So each additional unit will automatically fire the proper db hooks and loadbalancer hooks making sure every unit is setup exactly like the previous (in the case of MySQL, they'll be sharing the same MySQL database but it will skip re-installing the db for every unit) and HAProxy will loadbalance between each unit.
Same happens when you juju remote-unit mediawiki all the relavent hooks fire and each unit is removed from HAProxy.
that is cool.