How to install and configure Landscape for HA deployments
See also: Juju documentation
You can create a scalable, high availability (HA) deployment of Landscape Server by using Juju and the Landscape Scalable charm bundle. The result is a Juju-managed deployment of Landscape Server and the other services it depends on: HAProxy, RabbitMQ Server, and PostgreSQL.
Each of these services will have an independently scalable number of Juju units. Depending on your Juju cloud configuration, these units can be deployed to different availability zones to further improve resilience.
This is a simplified model of a full Landscape HA deployment:
Prerequisites
Before you can deploy the Landscape Scalable charm bundle, you need to:
These steps lay the groundwork for using Juju to deploy machine charms.
Machine charms are Juju-managed applications deployed on bare-metal servers, virtual machines, or system containers such as LXD. Landscape is only one of many charms that can be deployed from Charmhub and managed by Juju. Juju handles installing the applications and configuring them to work together.
Deploy the charm bundle
You can deploy the Landscape Scalable charm bundle using one of two main methods. The methods are:
- Deploy the bundle with the default configuration, then customize the configuration
- Download the bundle configuration, customize it, then deploy it
This guide describes both methods.
Option 1: Deploy with the default configuration
Once you have a Juju machine cloud configured, deploying the charm bundle with the default configuration is relatively straightforward.
Step 1: Create a Juju model
juju add-model landscape-self-hosted
Step 2: Deploy landscape-scalable
You can deploy the landscape-scalable
charm bundle directly.
juju deploy landscape-scalable
It will take some time for the bundle to finish deploying. You can watch the deployment progress with juju status
:
juju status --watch 3s
--watch
refreshes the status periodically. This example is set to refresh every three seconds.
You can also check the status at any time without --watch
:
juju status
At first, the juju status
output will indicate that all units are waiting for machines to become available:
Model Controller Cloud/Region Version SLA Timestamp
landscape-self-hosted localhost-localhost localhost/localhost 3.5.5 unsupported 15:12:31-08:00
App Version Status Scale Charm Channel Rev Exposed Message
haproxy waiting 0/1 haproxy latest/stable 75 yes waiting for machine
landscape-server waiting 0/1 landscape-server latest/stable 124 no waiting for machine
postgresql waiting 0/1 postgresql 14/stable 468 no waiting for machine
rabbitmq-server waiting 0/1 rabbitmq-server 3.9/stable 188 no waiting for machine
Unit Workload Agent Machine Public address Ports Message
haproxy/0 waiting allocating 0 waiting for machine
landscape-server/0 waiting allocating 1 waiting for machine
postgresql/0 waiting allocating 2 waiting for machine
rabbitmq-server/0 waiting allocating 3 waiting for machine
Machine State Address Inst id Base AZ Message
0 pending pending [email protected]
1 pending pending [email protected]
2 pending pending [email protected]
3 pending pending [email protected]
Once everything is installed and settled, the Status
for every application will be active
:
Model Controller Cloud/Region Version SLA Timestamp
landscape-self-hosted localhost-localhost localhost/localhost 3.5.5 unsupported 15:28:30-08:00
App Version Status Scale Charm Channel Rev Exposed Message
haproxy active 1 haproxy latest/stable 75 yes Unit is ready
landscape-server active 1 landscape-server latest/stable 124 no Unit is ready
postgresql 14.12 active 1 postgresql 14/stable 468 no
rabbitmq-server 3.9.27 active 1 rabbitmq-server 3.9/stable 188 no Unit is ready
Unit Workload Agent Machine Public address Ports Message
haproxy/0* active idle 0 10.76.244.244 80,443/tcp Unit is ready
landscape-server/0* active idle 1 10.76.244.6 Unit is ready
postgresql/0* active idle 2 10.76.244.26 5432/tcp Primary
rabbitmq-server/0* active idle 3 10.76.244.71 5672,15672/tcp Unit is ready
Machine State Address Inst id Base AZ Message
0 started 10.76.244.244 juju-dded29-0 [email protected] Running
1 started 10.76.244.6 juju-dded29-1 [email protected] Running
2 started 10.76.244.26 juju-dded29-2 [email protected] Running
3 started 10.76.244.71 juju-dded29-3 [email protected] Running
Step 3: Add application units
The following commands add two units each of Landscape Server, HAProxy, PostgreSQL, and RabbitMQ. Execute them to create your high availability deployment with three units of each service.
juju add-unit landscape-server -n 2
juju add-unit haproxy -n 2
juju add-unit postgresql -n 2
juju add-unit rabbitmq-server -n 2
The charms for each application handle relationships between the units. The unit indicated with an asterisk (*
) in the juju status
output is the current leader unit.
After the new units are given machines and the charm installation and setup is complete, the result is a high availability deployment:
Model Controller Cloud/Region Version SLA Timestamp
landscape-self-hosted localhost-localhost localhost/localhost 3.5.5 unsupported 15:49:11-08:00
App Version Status Scale Charm Channel Rev Exposed Message
haproxy active 3 haproxy latest/stable 75 yes Unit is ready
landscape-server active 3 landscape-server latest/stable 124 no Unit is ready
postgresql 14.12 active 3 postgresql 14/stable 468 no
rabbitmq-server 3.9.27 active 3 rabbitmq-server 3.9/stable 188 no Unit is ready
Unit Workload Agent Machine Public address Ports Message
haproxy/0* active idle 0 10.76.244.244 80,443/tcp Unit is ready
haproxy/1 active idle 6 10.76.244.204 80,443/tcp Unit is ready
haproxy/2 active idle 7 10.76.244.41 80,443/tcp Unit is ready
landscape-server/0* active idle 1 10.76.244.6 Unit is ready
landscape-server/1 active idle 4 10.76.244.192 Unit is ready
landscape-server/2 active idle 5 10.76.244.237 Unit is ready
postgresql/0* active idle 2 10.76.244.26 5432/tcp Primary
postgresql/1 active idle 8 10.76.244.43 5432/tcp
postgresql/2 active idle 9 10.76.244.32 5432/tcp
rabbitmq-server/0* active idle 3 10.76.244.71 5672,15672/tcp Unit is ready and clustered
rabbitmq-server/1 active idle 10 10.76.244.98 5672,15672/tcp Unit is ready and clustered
rabbitmq-server/2 active idle 11 10.76.244.71 5672,15672/tcp Unit is ready and clustered
Machine State Address Inst id Base AZ Message
0 started 10.76.244.244 juju-dded29-0 [email protected] Running
1 started 10.76.244.6 juju-dded29-1 [email protected] Running
2 started 10.76.244.26 juju-dded29-2 [email protected] Running
3 started 10.76.244.71 juju-dded29-3 [email protected] Running
4 started 10.76.244.192 juju-dded29-4 [email protected] Running
5 started 10.76.244.237 juju-dded29-5 [email protected] Running
6 started 10.76.244.204 juju-dded29-6 [email protected] Running
7 started 10.76.244.41 juju-dded29-7 [email protected] Running
8 started 10.76.244.43 juju-dded29-8 [email protected] Running
9 started 10.76.244.32 juju-dded29-9 [email protected] Running
10 started 10.76.244.98 juju-dded29-10 [email protected] Running
11 started 10.76.244.71 juju-dded29-11 [email protected] Running
You now have Landscape Server set up for a high-availability deployment. Next, you need to set up your clients by installing the Landscape Client charm on each client, and configuring them with the juju config
command. You may also need to change your SSL certificate configuration. See the configure HAProxy with an SSL certificate section in this guide for more information.
Option 2: Customize the configuration before deployment
If you would rather do all of your configuration up-front and then let Juju orchestrate everything during deployment, you can download the charm bundle’s YAML file and customize it.
Step 1: Download the landscape-scalable
charm bundle
juju download landscape-scalable
You’ll get output similar to:
Fetching bundle "landscape-scalable" revision 37 using "stable" channel and base "amd64/ubuntu/22.04"
Install the "landscape-scalable" bundle with:
juju deploy ./landscape-scalable_r37.bundle
Then, unzip it:
unzip ./landscape-scalable_r37.bundle
You’ll get output similar to:
Archive: ./landscape-scalable_r37.bundle
inflating: bundle.yaml
inflating: README.md
inflating: manifest.yaml
Step 2: Edit the bundle.yaml
file
You need to increase the num_units
for each application to turn your deployment into a high
availability deployment. In this example, we set each service to num_units: 3
. This means there will be three units of each Landscape Server, HAProxy, PostgreSQL, and RabbitMQ.
description: Landscape Scalable
name: landscape-scalable
series: jammy
docs: https://discourse.charmhub.io/t/landscape-charm-bundles/10638
applications:
haproxy:
charm: ch:haproxy
channel: stable
revision: 75
num_units: 3
expose: true
options:
default_timeouts: queue 60000, connect 5000, client 120000, server 120000
global_default_bind_options: no-tlsv10
services: ""
ssl_cert: SELFSIGNED
landscape-server:
charm: ch:landscape-server
channel: stable
revision: 124
num_units: 3
constraints: mem=4096
options:
landscape_ppa: ppa:landscape/self-hosted-24.04
postgresql:
charm: ch:postgresql
channel: 14/stable
revision: 468
num_units: 3
options:
plugin_plpython3u_enable: true
plugin_ltree_enable: true
plugin_intarray_enable: true
plugin_debversion_enable: true
plugin_pg_trgm_enable: true
experimental_max_connections: 500
constraints: mem=2048
rabbitmq-server:
charm: ch:rabbitmq-server
channel: 3.9/stable
revision: 188
num_units: 3
options:
consumer-timeout: 259200000
relations:
- [landscape-server, rabbitmq-server]
- [landscape-server, haproxy]
- [landscape-server:db, postgresql:db-admin]
Step 3: Deploy the bundle.yaml
file
juju deploy ./bundle.yaml
It will take some time for the bundle to finish deploying, you can watch the deployment progress with juju status
:
juju status --watch 3s
--watch
refreshes the status periodically. This example is set to refresh every three seconds.
You can also check the status at any time without --watch
:
juju status
At first, the juju status
output will indicate that all units are waiting for machines to become available:
Model Controller Cloud/Region Version SLA Timestamp
landscape-self-hosted localhost-localhost localhost/localhost 3.5.5 unsupported 16:20:40-08:00
App Version Status Scale Charm Channel Rev Exposed Message
haproxy waiting 0/3 haproxy latest/stable 75 yes waiting for machine
landscape-server waiting 0/3 landscape-server latest/stable 124 no waiting for machine
postgresql waiting 0/3 postgresql 14/stable 468 no waiting for machine
rabbitmq-server waiting 0/3 rabbitmq-server 3.9/stable 188 no waiting for machine
Unit Workload Agent Machine Public address Ports Message
haproxy/0 waiting allocating 0 waiting for machine
haproxy/1 waiting allocating 1 waiting for machine
haproxy/2 waiting allocating 2 waiting for machine
landscape-server/0 waiting allocating 3 waiting for machine
landscape-server/1 waiting allocating 4 waiting for machine
landscape-server/2 waiting allocating 5 waiting for machine
postgresql/0 waiting allocating 6 waiting for machine
postgresql/1 waiting allocating 7 waiting for machine
postgresql/2 waiting allocating 8 waiting for machine
rabbitmq-server/0 waiting allocating 9 waiting for machine
rabbitmq-server/1 waiting allocating 10 waiting for machine
rabbitmq-server/2 waiting allocating 11 waiting for machine
Machine State Address Inst id Base AZ Message
0 pending pending [email protected]
1 pending pending [email protected]
2 pending pending [email protected]
3 pending pending [email protected]
4 pending pending [email protected]
5 pending pending [email protected]
6 pending pending [email protected]
7 pending pending [email protected]
8 pending pending [email protected]
9 pending pending [email protected]
10 pending pending [email protected]
11 pending pending [email protected]
Once everything is installed and settled, the Status
for every application will be active
:
Model Controller Cloud/Region Version SLA Timestamp
landscape-self-hosted localhost-localhost localhost/localhost 3.5.5 unsupported 16:30:52-08:00
App Version Status Scale Charm Channel Rev Exposed Message
haproxy waiting 3 haproxy latest/stable 75 yes Unit is ready
landscape-server waiting 3 landscape-server latest/stable 124 no Unit is ready
postgresql waiting 3 postgresql 14/stable 468 no
rabbitmq-server waiting 3 rabbitmq-server 3.9/stable 188 no Unit is ready
Unit Workload Agent Machine Public address Ports Message
haproxy/0* active idle 0 10.76.244.87 80,443/tcp Unit is ready
haproxy/1 active idle 1 10.76.244.102 80,443/tcp Unit is ready
haproxy/2 active idle 2 10.76.244.250 80,443/tcp Unit is ready
landscape-server/0* active idle 3 10.76.244.17 Unit is ready
landscape-server/1 active idle 4 10.76.244.212 Unit is ready
landscape-server/2 active idle 5 10.76.244.170 Unit is ready
postgresql/0* active idle 6 10.76.244.112 5432/tcp Primary
postgresql/1 active idle 7 10.76.244.166 5432/tcp
postgresql/2 active idle 8 10.76.244.165 5432/tcp
rabbitmq-server/0* active idle 9 10.76.244.14 5672,15672/tcp Unit is ready and clustered
rabbitmq-server/1 active idle 10 10.76.244.237 5672,15672/tcp Unit is ready and clustered
rabbitmq-server/2 active idle 11 10.76.244.179 5672,15672/tcp Unit is ready and clustered
Machine State Address Inst id Base AZ Message
0 started 10.76.244.87 juju-be1fab-0 [email protected] Running
1 started 10.76.244.102 juju-be1fab-1 [email protected] Running
2 started 10.76.244.250 juju-be1fab-2 [email protected] Running
3 started 10.76.244.17 juju-be1fab-3 [email protected] Running
4 started 10.76.244.212 juju-be1fab-4 [email protected] Running
5 started 10.76.244.170 juju-be1fab-5 [email protected] Running
6 started 10.76.244.112 juju-be1fab-6 [email protected] Running
7 started 10.76.244.166 juju-be1fab-7 [email protected] Running
8 started 10.76.244.165 juju-be1fab-8 [email protected] Running
9 started 10.76.244.14 juju-be1fab-9 [email protected] Running
10 started 10.76.244.237 juju-be1fab-10 [email protected] Running
11 started 10.76.244.179 juju-be1fab-11 [email protected] Running
You now have Landscape Server set up for a high-availability deployment. Next, you need to set up your clients by installing the Landscape Client charm on each client, and configuring them with the juju config
command. You may also need to change your SSL certificate configuration. See the configure HAProxy with an SSL certificate section in this guide for more information.
Configure HAProxy with an SSL certificate
If you followed the previous instructions in this guide, you’ll have a Landscape Server high availability deployment. The HAProxy application in this deployment uses a self-signed SSL certificate for secure HTTPS. Landscape Clients and your browser won’t trust this certificate by default.
If you have a valid SSL certificate, you can configure HAProxy to use it by executing the following juju config
commands. fullchain.pem
is the public, full-chain SSL certificate and privkey.pem
is the certificate’s private key.
juju config haproxy ssl_cert="$(base64 fullchain.pem)" ssl_key="$(base64 privkey.pem)"
Once your SSL certificate is in place, your Landscape Clients and browser should trust HTTPS connections to your Landscape Server deployment, so long as your certificate remains valid.