How to configure MySQL master master replication but use only one server for writing? [closed]

dba.stackexchange https://dba.stackexchange.com/questions/268927

  •  03-03-2021
  •  | 
  •  

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?

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 dba.stackexchange
scroll top