Documentation Home
MySQL 8.0 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 48.2Mb
PDF (A4) - 48.3Mb
PDF (RPM) - 43.9Mb
HTML Download (TGZ) - 11.0Mb
HTML Download (Zip) - 11.1Mb
HTML Download (RPM) - 9.5Mb
Man Pages (TGZ) - 239.7Kb
Man Pages (Zip) - 343.4Kb
Info (Gzip) - 4.4Mb
Info (Zip) - 4.4Mb
Excerpts from this Manual

MySQL 8.0 Reference Manual  /  ...  /  Using Replica Sets with MySQL Router

21.6.6 Using Replica Sets with MySQL Router

You can use MySQL Router 8.0.19 and later to bootstrap against a ReplicaSet, in the same way that InnoDB cluster can be bootstrapped. See Section 21.4, “Using MySQL Router with InnoDB Cluster”. 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 a 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 exactly the same way as with InnoDB cluster. See Working with a Cluster's Routers for information on ReplicaSet.listRouters() and ReplicaSet.removeRouterMetadata().