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.
 
 
 
Alex Kavanagh 7431fd21f1 Test bundles for focal-wallaby and hirsute-wallaby 3 months ago
actions Improved action to display the cluster status 3 months ago
charmhelpers 21.04 sync - add 'hirsute' in UBUNTU_RELEASES 2 months ago
files NRPE: Don't report paused hacluster nodes as CRITICAL error 7 months ago
hooks Fix pacemaker-remote-relation-changed hook error 3 months ago
lib Update tox.ini files from release-tools gold copy 5 years ago
templates Convert charm to Python 3 2 years ago
tests Test bundles for focal-wallaby and hirsute-wallaby 1 month ago
unit_tests Fix pacemaker-remote-relation-changed hook error 3 months ago
.gitignore Support network space binding of hanode relation 4 years ago
.gitreview OpenDev Migration Patch 2 years ago
.project Refactoring to use openstack charm helpers. 8 years ago
.pydevproject Refactoring to use openstack charm helpers. 8 years ago
.stestr.conf Replace ostestr with stestr in testing framework. 2 years ago
.zuul.yaml Fix installing dnspython on python 3.5 11 months ago
LICENSE Re-license charm as Apache-2.0 5 years ago
Makefile Port hacluster tests from Amulet to Zaza 2 years ago
README.md Improved action to display the cluster status 3 months ago
actions.yaml Improved action to display the cluster status 3 months ago
charm-helpers-hooks.yaml Updates to flip all libraries back to master 1 month ago
config.yaml Adjust quorum after node removal 3 months ago
copyright Re-license charm as Apache-2.0 5 years ago
icon.svg Add icon and category 7 years ago
metadata.yaml Add hirsute and remove trusty from metadata.yaml 3 months ago
osci.yaml Test bundles for focal-wallaby and hirsute-wallaby 1 month ago
requirements.txt Sync release-tools 6 months ago
setup.cfg fix coverage settings 6 years ago
test-requirements.txt Updates to flip all libraries back to master 1 month ago
tox.ini Sync release-tools 6 months 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.

update-ring action

The update-ring action requires a parameter (i-really-mean-it=true) to make sure tidying up the list of available corosync nodes in the ring is intended.

The operation expects:

  1. juju run-action hacluster/N pause --wait. This will make sure no Pacemaker resources run on the unit.

  2. juju remove-unit principal-unit/N. Iterate through this step as many times as units want to be removed (ie. to scale back from 6 to 3 units).

  3. juju run-action hacluster/leader update-ring i-really-mean-it=true --wait. This step will remove corosync nodes from the ring and update corosync.conf to list an updated number of nodes (min_quorum is recalculated).

In case a unit goes into lost state (ie. caused by hardware failure), the initial step (pause a unit) can be skipped. Unit removal may also be replaced by juju remove-machine N --force, where N is the Juju machine ID where the unit to be removed runs.

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.