Juju Charm - HACluster
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Zuul 073095a613 Merge "Catch FileExistsError when creating /etc/corosync dir." 7 days ago
actions Safely delete node from ring 11 months ago
charmhelpers Add yoga bundles and release-tool syncs 6 months ago
files Fix standby node regex for check_crm 2 weeks ago
hooks Catch FileExistsError when creating /etc/corosync dir. 2 weeks ago
lib Update tox.ini files from release-tools gold copy 6 years ago
templates Render corosync.conf file prior to pkg install 2 months ago
tests Updates for jammy enablement 1 month ago
unit_tests Catch FileExistsError when creating /etc/corosync dir. 2 weeks ago
.gitignore Update to classic charms to build using charmcraft in CI 3 months ago
.gitreview OpenDev Migration Patch 3 years ago
.project Refactoring to use openstack charm helpers. 9 years ago
.pydevproject Refactoring to use openstack charm helpers. 9 years ago
.stestr.conf Replace ostestr with stestr in testing framework. 3 years ago
.zuul.yaml Updates for jammy enablement 1 month ago
LICENSE Re-license charm as Apache-2.0 6 years ago
Makefile Port hacluster tests from Amulet to Zaza 2 years ago
README.md Remove moved content from README 11 months ago
actions.yaml Safely delete node from ring 11 months ago
build-requirements.txt Update to classic charms to build using charmcraft in CI 3 months ago
charm-helpers-hooks.yaml Updates to flip all libraries back to master 1 year ago
charmcraft.yaml Updates for jammy enablement 1 month ago
config.yaml Add option for no-quorum-policy 11 months ago
copyright Re-license charm as Apache-2.0 6 years ago
icon.svg Add icon and category 8 years ago
metadata.yaml Updates for jammy enablement 1 month ago
osci.yaml Updates for jammy enablement 1 month ago
pip.sh Add xena bundles 8 months ago
rename.sh Update to classic charms to build using charmcraft in CI 3 months ago
requirements.txt Update to classic charms to build using charmcraft in CI 3 months ago
setup.cfg fix coverage settings 7 years ago
test-requirements.txt Update to classic charms to build using charmcraft in CI 3 months ago
tox.ini Updates for jammy enablement 1 month ago

README.md

Overview

The hacluster charm provides high availability for OpenStack applications that lack native (built-in) HA functionality. The clustering solution is based on Corosync and Pacemaker.

It is a subordinate charm that works in conjunction with a principle charm that supports the 'hacluster' interface. The current list of such charms can be obtained from the Charm Store (the charms officially supported by the OpenStack Charms project are published by 'openstack-charmers').

See OpenStack high availability in the OpenStack Charms Deployment Guide for a comprehensive treatment of HA with charmed OpenStack.

Note: The hacluster charm is generally intended to be used with MAAS-based clouds.

Usage

High availability can be configured in two mutually exclusive ways:

  • virtual IP(s)
  • DNS

The virtual IP method of implementing HA requires that all units of the clustered OpenStack application are on the same subnet.

The DNS method of implementing HA requires that MAAS is used as the backing cloud. The clustered nodes must have static or "reserved" IP addresses registered in MAAS. If using a version of MAAS earlier than 2.3 the DNS hostname(s) should be pre-registered in MAAS before use with DNS HA.

Configuration

This section covers common configuration options. See file config.yaml for the full list of options, along with their descriptions and default values.

cluster_count

The cluster_count option sets the number of hacluster units required to form the principle application cluster (the default is 3). It is best practice to provide a value explicitly as doing so ensures that the hacluster charm will wait until all relations are made to the principle application before building the Corosync/Pacemaker cluster, thereby avoiding a race condition.

Deployment

At deploy time an application name should be set, and be based on the principle charm name (for organisational purposes):

juju deploy hacluster <principle-charm-name>-hacluster

A relation is then added between the hacluster application and the principle application.

In the below example the VIP approach is taken. These commands will deploy a three-node Keystone HA cluster, with a VIP of 10.246.114.11. Each will reside in a container on existing machines 0, 1, and 2:

juju deploy -n 3 --to lxd:0,lxd:1,lxd:2 --config vip=10.246.114.11 keystone
juju deploy --config cluster_count=3 hacluster keystone-hacluster
juju add-relation keystone-hacluster:ha keystone:ha

Actions

This section lists Juju actions supported by the charm. Actions allow specific operations to be performed on a per-unit basis.

  • pause
  • resume
  • status
  • cleanup
  • update-ring

To display action descriptions run juju actions hacluster. If the charm is not deployed then see file actions.yaml.

Presenting status information

Here are a few examples of how to present useful information with the status action and the jq utility.

  • Querying for online and standby parameter values:

    juju run-action --wait hacluster/leader status \
      --format json | jq '.[] | {(.UnitId):.results.result | fromjson \
      | .nodes | .[] | {unit_name: .name, online: .online, standby: .standby}}'
    

    output example

    {
      "hacluster/0": {
        "unit_name": "juju-a37bc0-3",
        "online": "true",
        "standby": "false"
      }
    }
    {
      "hacluster/0": {
        "unit_name": "juju-a37bc0-4",
        "online": "true",
        "standby": "false"
      }
    }
    {
      "hacluster/0": {
        "unit_name": "juju-a37bc0-5",
        "online": "true",
        "standby": "false"
      }
    }
    
  • Displaying cluster resource information:

    juju run-action --wait hacluster/leader status \
      --format json | jq '.[] | {(.UnitId):.results.result | fromjson \
      | .resources.groups}'
    

Bugs

Please report bugs on Launchpad.

For general charm questions refer to the OpenStack Charm Guide.