mysql router #61

Supports: focal groovy hirsute impish


MySQL Router proxying communication between application clients and MySQL InnoDB Clusters.


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.


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 <--->


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


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').


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


The OpenStack Charms project maintains two documentation guides:


Please report bugs on Launchpad.


(int) Time (in seconds) between the auth-cache refresh attempts. Defaults to 2. The value must be smaller than auth_cache_ttl and ttl else Router won't start.
(int) Time (in seconds) until the cache becomes invalid if not refreshed. Defaults to -1 (infinite). The value must be larger than auth_cache_refresh_interval else Router won't start.
(int) Base port number for RW interface. RO, xRW and xRO will increment from base_port.
(string) Repository from which to install. May be one of the following: distro (default), ppa:somecustom/ppa, a deb url sources entry, or a supported Ubuntu Cloud Archive e.g. . cloud:<series>-<openstack-release> cloud:<series>-<openstack-release>/updates cloud:<series>-<openstack-release>/staging cloud:<series>-<openstack-release>/proposed . See for info on which cloud archives are available and supported.
(string) TLS CA to use to communicate with other components in a deployment. . __NOTE__: This configuration option will take precedence over any certificates received over the ``certificates`` relation.
(string) TLS certificate to install and use for any listening services. . __NOTE__: This configuration option will take precedence over any certificates received over the ``certificates`` relation.
(string) TLS key to use with certificate specified as ``ssl_cert``. . __NOTE__: This configuration option will take precedence over any certificates received over the ``certificates`` relation.
(float) Time to live (in seconds) of information in the metadata cache. Accepts either an integer or a floating point value. The granularity is limited to milliseconds, where 0.001 equates to one millisecond. Precision is truncated to the supported range; for example ttl=0.0119 is treated as 11 milliseconds. The value 0 means that the metadata cache module queries the metadata continuously in a tight loop.
(boolean) Setting this to True will allow supporting services to log to syslog.