Question

How to configure MySQL master master replication but use only one server for writing? Is it done at LB end and how? If two users work on same db and same table and they both enter a data into it which users data will replicate first and will there be any loss of data or data will overwrite?

Was it helpful?

Solution

To use only one server for writing you point your application at only one server. You can do this explicitly in your application's database connection configuration. Or you can have a load balancer only forward connections to one node.

If you want read-write splitting either you have to code that into your application or you need an advanced load balancer like MaxScale that is fully transaction aware.

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top