MySQL Simple Router Config - Dump metadata-cache-d Destination server value

136 views Asked by At

This is part of the config

[routing:MYCLUSTER_x_rw]
bind_address=0.0.0.0
bind_port=3308
socket=/opt/mysql/MYCLUSTER_x_rw/mysqlx.sock
destinations=metadata-cache://MYCLUSTER_x_rw/?role=PRIMARY   #  <----- I need to know the host names
routing_strategy=first-available
protocol=x

I need to figure out what is the actual destinations key's value going to be once the router is going to start up. How do I find that out?

1

There are 1 answers

0
Lyudmila Sun On

Have a look at the configuration file options documentation.

In short, just change MYCLUSTER_x_rw to the name of the cluster you created. If you created the mysql innodb cluster by shell as dba.createCluster('testCluster');, then in the config file you should write destinations=metadata-cache://testCluster/?role=PRIMARY.

Please notice, if you use metadata-cache for destinations, you have to define it in the config file as below:

[metadata_cache:bootstrap]
cluster_type=gr
router_id=1
user=mysql_router1_ppwqrnhzsbj9
metadata_cluster=testCluster
ttl=0.5
auth_cache_ttl=-1
auth_cache_refresh_interval=2
use_gr_notifications=0

Here is another example of the full config file.