|
|
|
|
|
by boxein
5186 days ago
|
|
What does "add-relation" do, in terms of what happens on the machine? Do different charms need to be coded with explicit relation types? 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.