6.10.4 Using ReplicaSets with MySQL Router

You can use MySQL Router 8.0.19 and later to bootstrap against an InnoDB ReplicaSet. For more information, see Section 6.10, β€œUsing MySQL Router with AdminAPI, InnoDB Cluster, and InnoDB ReplicaSet”. The only difference in the generated MySQL Router configuration file is the addition of the cluster_type option. When MySQL Router is bootstrapped against a ReplicaSet, the generated configuration file includes:

cluster_type=rs

When you use MySQL Router with InnoDB ReplicaSet, be aware that:

  • The read-write port of MySQL Router directs client connections to the primary instance of the ReplicaSet.

  • The read-only port of MySQL Router direct client connections to a secondary instance of the ReplicaSet, although it could also direct them to the primary.

  • MySQL Router obtains information about the ReplicaSet's topology from the primary instance.

  • MySQL Router automatically recovers when the primary instance becomes unavailable and a different instance is promoted.

You work with the MySQL Router instances which have been bootstrapped against a ReplicaSet in the same way as with InnoDB Cluster. For more information on ReplicaSet.listRouters() and ReplicaSet.removeRouterMetadata(), see Section 6.10.6, β€œWorking with a Cluster's Routers” .