Bug #86252 MySQL Router 2.1.3 doesn't connect to remote mysql server
Submitted: 10 May 2017 3:17 Modified: 12 May 2017 23:21
Reporter: Suresh Rajagopal Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Router Severity:S2 (Serious)
Version:2.1.3.1 OS:Any
Assigned to: CPU Architecture:Any

[10 May 2017 3:17] Suresh Rajagopal
Description:
MySQL router is connecting to server installed on a different server

How to repeat:
Install MySQL Cluster sandbox using mysql shell
Followed steps from https://dev.mysql.com/doc/refman/5.7/en/mysql-innodb-cluster-getting-started.html#idc-depl...

Install MySQL router on a different server
Bootstrap mysql router using below command
 mysqlrouter --bootstrap mysqlserver1:3310 --user=mysql --directory=/opt/router1 --name=router1 --conf-base-port=6446
Bootstrapping MySQL Router instance at /opt/router1...
MySQL Router 'router1' has now been configured for the InnoDB cluster 'TestCluster'.

The following connection information can be used to connect to the cluster.

Classic MySQL protocol connections to cluster 'TestCluster':
- Read/Write Connections: localhost:6446
- Read/Only Connections: localhost:6447

X protocol connections to cluster 'TestCluster':
- Read/Write Connections: localhost:6448
- Read/Only Connections: localhost:6449

Start router
/opt/router1/start.sh

Following error is thrown into the log file

2017-05-09 17:27:59 ERROR   [7f8ff8be0700] While updating metadata, could not establish a connection to replicaset 'default' through 127.0.0.1:3310
2017-05-09 17:27:59 ERROR   [7f8ff8be0700] While updating metadata, could not establish a connection to replicaset 'default' through 127.0.0.1:3320
2017-05-09 17:27:59 ERROR   [7f8ff8be0700] While updating metadata, could not establish a connection to replicaset 'default' through 127.0.0.1:3330

MySQL Server Version : 5.7.18
MySQL Router Version: 2.1.3.1

Router Configuration file
# File automatically generated during MySQL Router bootstrap
[Default]
name=router1
user=mysql
logging_folder=/opt/router1/log
runtime_folder=/opt/router1/run
data_folder=/opt/router1/data
keyring_path=/opt/router1/data/keyring
master_key_path=/opt/router1/mysqlrouter.key

[logger]
level = DEBUG

[metadata_cache:TestCluster]
router_id=37
bootstrap_server_addresses=mysql://localhost:3310,mysql://localhost:3320,mysql://localhost:3330
user=mysql_router37_7txk7fg50dpz
metadata_cluster=TestCluster
ttl=300

[routing:TestCluster_default_rw]
bind_address=0.0.0.0
bind_port=6446
destinations=metadata-cache://TestCluster/default?role=PRIMARY
mode=read-write
protocol=classic

[routing:TestCluster_default_ro]
bind_address=0.0.0.0
bind_port=6447
destinations=metadata-cache://TestCluster/default?role=SECONDARY
mode=read-only
protocol=classic

[routing:TestCluster_default_x_rw]
bind_address=0.0.0.0
bind_port=6448
destinations=metadata-cache://TestCluster/default?role=PRIMARY
mode=read-write
protocol=x

[routing:TestCluster_default_x_ro]
bind_address=0.0.0.0
bind_port=6449
destinations=metadata-cache://TestCluster/default?role=SECONDARY
mode=read-only
protocol=x
[12 May 2017 23:21] Suresh Rajagopal
This happens only when using router with a remote sandbox innodb cluster. If we use 3 separate servers to setup an innodb cluster, router works fine.

Thanks
Suresh