MySQL Replication and myAppExample, which IP to point the app to? To the Master, Router, one of the slaves?

I setup a typical lamp stack and also a MySQL InnoDB cluster.

myAppExample: 10.3.1.9 mysql-0 : 10.3.1.10 mysql-1 : 10.3.1.11 mysql-2 : 10.3.1.12 mysql-router: 10.3.1.13

What is the norm, best practice, or intended use of the replication method?

Should I point my myAppExample to the mysql-0 (master), or to the Router? Or to one of the slaves?

I would think to point it to the router, so the cluster will route traffic to read or write accordingly for performance.

Do I point it to the router or to the master?

Thank you.

I've never done this, and I can't find documentation anywhere where to point the app after you set it up.

1

There are 1 best solutions below

0
On

Solved. There are a few questions here, let me address each of them.

You must point your myAppExample to the Router, not to node 0(master), nor other nodes 1,2,3,etc(slaves).

Yes, the app will refuse the connection to the mysql router, say it's at 10.3.1.12. Connection works to the master(node-0), 10.3.1.9, since it looks for port 3306 by default.

You must specify which port to connect to the router, it's not port 3306, it's port 6446, So in your app, you connect to your mysql server(actually the router), like this, 10.3.1.12:6446