Files
charm-mysql-router/src
Liam Young 7488ce17a5 Restart router if connections fail with 2003 code
At the moment if a connection through the router fails after a
configuration update the router is only restarted if the connection
error has a code of 2013 but often the error thrown is 2003 (see
*1) . This patch alters the charms
behaviour to also restart the router on a 2013 error.

While testing this patch it became apparent that a connection
attempt through the router immediatly after the router has been
restarted very often fail. So, the connection attempt has been
moved into its own method with its own tenacity retry logic.
A side effect of this is that the total possible wait time
has increased from 5 * 10 (outer tenacity loop) to 5 * 10 * 5
(outer tenacity loop and inner tenacity loop).

*1 https://dev.mysql.com/doc/mysql-errors/8.0/en/client-error-reference.html

Closes-Bug: #1973177
Change-Id: I9c2846bf4f21d2dcb1958bee4c9fa72dd4464b6c
(cherry picked from commit 5942b035f6)
2022-05-25 12:18:38 -04:00
..
2020-07-27 20:55:09 +01:00
2022-04-19 08:43:59 +00:00
2019-10-17 09:41:43 -07:00
2019-10-04 14:12:47 -07:00
2022-05-20 09:42:53 -04:00
2022-04-14 11:17:41 +02:00
2021-09-27 11:08:50 +02:00
2021-09-27 11:08:50 +02:00

Overview

The mysql-router charm provides a MySQL 8 Router; it proxies database requests from a principle application to a MySQL 8 InnoDB Cluster. MySQL Router handles cluster communication and understands the cluster schema.

It is a subordinate charm that is used in conjunction with the mysql-innodb-cluster charm. It is also used with a principle charm that supports the 'mysql-shared' 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').

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

The charm is deployed as a subordinate to a principle application and then related to the central mysql-innodb-cluster application:

principle charm A <---> mysql-router A <--->
principle charm B <---> mysql-router B <---> mysql-innodb-cluster
principle charm C <---> mysql-router C <--->

Configuration

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

Deployment

To deploy a MySQL 8 Router for joining, say, Keystone to the cloud database:

juju deploy mysql-router keystone-mysql-router

Note

: The mysql-router application is typically given a name that corresponds to the associated principle application.

Add a relation to the principle application (via the shared-db endpoint):

juju add-relation keystone:shared-db keystone-mysql-router:shared-db

Then add a relation to the mysql-innodb-cluster application (via the db-router endpoint):

juju add-relation keystone-msyql-router:db-router mysql-innodb-cluster:db-router

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.

Scale out is accomplished by adding units to the principle application:

juju add-unit keystone

Note

: If more than one mysql-router application is placed on the same machine the base-port configuration option is needed to ensure non-conflicting TCP port numbers are used (the default is '3306').

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-router. If the charm is not deployed then see file actions.yaml.

  • stop-mysqlrouter
  • start-mysqlrouter
  • restart-mysqlrouter

Documentation

The OpenStack Charms project maintains two documentation guides:

Bugs

Please report bugs on Launchpad.