N44 High-availability

By default Juju distributes units of an application so as to maximise service availability. Juju-deployed applications are less susceptible to localised outages affecting the underlying cloud because of how Juju manages distribution groups.

See Controller high availability for details on enabling high availability for the controller.

Distribution groups

A distribution group is formed by all of the units of an application. Every time a unit is added to a distribution group, Juju considers where the existing members are running and deploys the unit to ensure maximum geographical distribution across cloud infrastructure.

Availability zones

Juju reasons about distribution based on availability zones. Availability zones are a common concept across clouds.

Juju supports the availability zone implementations on Google Compute Engine, VMware vSphere, Amazon’s EC2, OpenStack-based clouds, and MAAS. See the Clouds page for more details on these and other cloud-specific settings.

Where the cloud’s availability zones are known to Juju, each new unit of an application will be deployed to an availability zone hosting the fewest units of the distribution group.

Availability zones allow for the automatic and uniform distribution of units across a region. A new instance, for example, will be allocated the zone with the fewest members of its distribution group.

As stated, Juju does this automatically so in this example:

juju deploy -n 10 <application>

The application units will be uniformly distributed across the availability zones in the current region.

Placement directives circumvent the default distribution group behaviour. Examples of placement directives are as follows:

juju deploy <application> --to zone=us-east-1b

juju add-unit <application> --to zone=us-east-1c

Azure availability sets

Juju supports availability sets on Microsoft’s Azure (see Using Microsoft Azure with Juju. As long as at least two units are deployed, Azure guarantees 99.95% availability of the application overall. Exposed ports are automatically load-balanced across all units within the application. Using availability sets disables manual placement and the add-machine command.

New Azure environments use availability sets by default. This behaviour can be disabled only when bootstrapping the cloud by adding availability-sets-enabled=false as a configuration option:

juju bootstrap --config availability-sets-enabled=false azure mycloud

By disabling availability sets, you will lose Azure’s SLA guarantees. See Azure SLA to learn how availability sets affect uptime guarantees.

Once an environment has been bootstrapped, you cannot change whether it uses availability sets. You would have to tear it down and create a new environment.

Availability sets work differently from zones, but serve the same basic purpose. With zones, Juju directly ensures each unit of a distribution group is placed into a different zone. With sets, Juju places each unit of a distribution group into the same set, and Azure will then try to ensure that not all units in the set will become unavailable at the same time.

Availability sets are not enforced when unit placement (i.e. the --to option for the deploy or add-unit commands) is used.