Files
charm-mysql-innodb-cluster/src/README.md
Billy Olsen a4599fba13 Update readme with Juju 3 compatible commands
Add Juju 3 compatible commands to the README.

Change-Id: I221a2c09d1d56809e3ffe75ac42bae9502389a79
2024-06-10 02:23:59 +00:00

5.1 KiB

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:

For Juju 2.x:

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

For Juju 3.x:

juju deploy mysql-router keystone-mysql-router
juju integrate keystone-mysql-router:db-router mysql-innodb-cluster:db-router
juju integrate 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 from the leader unit. This command varies slightly between Juju 2.x and Juju 3.x versions.

For Juju 2.x:

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

For Juju 3.x:

juju exec --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:

For Juju 2.x:

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

For Juju 3.x:

juju integrate 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:

For Juju 2.x:

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>

For Juju 3.x:

juju run --wait mysql-innodb-cluster/leader update-unit-acls
juju run --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.