charm-mysql-innodb-cluster/src
Zuul 253c24011d Merge "Improve add/remove actions" 2024-04-22 13:18:37 +00:00
..
actions Merge "Add extended parameter for cluster-status" 2024-04-03 09:14:20 +00:00
files Upstream charm 2019-10-17 09:09:50 -07:00
lib Merge "Improve add/remove actions" 2024-04-22 13:18:37 +00:00
reactive Delay prom_exporter user creation until password is available. 2023-08-28 21:12:39 -04:00
templates Set relay_log_recovery = ON by default 2023-05-31 11:48:08 +01:00
tests Drop "full-model" CI jobs. 2023-09-01 15:14:20 -04:00
HACKING.md Documentation corrections 2019-11-08 13:29:32 -08:00
README.md Fix LP 1936704 2021-09-27 14:40:54 -04:00
actions.yaml Merge "Improve add/remove actions" 2024-04-22 13:18:37 +00:00
config.yaml Remove reference to performance-schema option that doesn't exist 2023-05-31 10:22:30 +01:00
icon.svg MySQL InnoDB Cluster Charm 2019-10-04 14:05:20 -07:00
layer.yaml Prometheus mysqld exporter 2022-10-21 09:31:11 +08:00
metadata.yaml Add docs key and point at Discourse 2023-09-01 19:14:54 +00:00
test-requirements.txt Fix charm for tox4 compatibility 2023-01-17 16:45:55 +00:00
tox.ini Fix charm for tox4 compatibility 2023-01-17 16:45:55 +00:00
wheelhouse.txt fix(src/wheelhouse.txt): Add poetry-core to wheelhouse 2022-09-13 06:35:12 +00:00

README.md

Overview

The mysql-innodb-cluster charm deploys a MySQL 8 InnoDB clustered database (i.e. MySQL InnoDB Cluster). It is used in conjunction with the mysql-router subordinate charm.

Important: The eoan series is the first series supported by the mysql-innodb-cluster and mysql-router charms. These charms replace the percona-cluster charm starting with the focal series.

Usage

Configuration

See file config.yaml of the built charm (or see the charm in the Charm Store) for the full list of configuration options, along with their descriptions and default values. See the Juju documentation for details on configuring applications.

Deployment

MySQL 8 is natively HA and requires at least three database units, which are often containerised. To deploy a three-node cluster to new containers on machines '0', '1', and '2':

juju deploy -n 3 --to lxd:0,lxd:1,lxd:2 mysql-innodb-cluster

A cloud application is joined to the database via an instance of mysql-router. For a pre-existing keystone application:

juju deploy mysql-router keystone-mysql-router
juju add-relation keystone-mysql-router:db-router mysql-innodb-cluster:db-router
juju add-relation keystone-mysql-router:shared-db keystone:shared-db

Important: When network spaces are used, the mysql-router and mysql-innodb-cluster charms must be configured such that the 'db-router' endpoint is bound to the same space.

See Infrastructure high availability in the OpenStack Charms Deployment Guide for more deploy information.

Root password

Passwords are automatically generated and stored by the application leader.

The root password required to use the mysql or mysqlsh utilities locally on the units can be retrieved using the following command:

juju run --unit mysql-innodb-cluster/leader leader-get mysql.passwd

TLS

TLS communication between MySQL InnoDB Cluster and its cloud clients is supported out of the box via a self-signed CA certificate bundled within MySQL itself. However, a better option is to use a certificate signed by a Vault-based CA. This can be done once Vault has been initialised and has a root CA:

juju add-relation mysql-innodb-cluster:certificates vault:certificates

See the vault charm README for more information.

Adding a unit on a new subnet

When adding a unit to an already formed cluster, and where that unit resides on a subnet different from any existing unit, the following extra actions are needed:

juju run-action --wait mysql-innodb-cluster/leader update-unit-acls
juju run-action --wait mysql-innodb-cluster/leader add-instance address=<address of new unit>

Actions

This section lists Juju actions supported by the charm. Actions allow specific operations to be performed on a per-unit basis. To display action descriptions run juju actions --schema mysql-innodb-cluster. If the charm is not deployed then see file actions.yaml.

  • add-instance
  • cluster-rescan
  • cluster-status
  • mysqldump
  • reboot-cluster-from-complete-outage
  • rejoin-instance
  • remove-instance
  • restore-mysqldump
  • set-cluster-option
  • update-unit-acls

Documentation

The OpenStack Charms project maintains two documentation guides:

Bugs

Please report bugs on Launchpad.