简体   繁体   English

MySQL多主复制多位置

[英]MySQL Multi-Master Replication multi location

I have a database which runs in two remote locations. 我有一个在两个远程位置运行的数据库。 (A & B) The server is available locally on one location (A). (A和B)服务器在一个位置(A)上本地可用。 However, the second location (B) accesess the database over the internet. 但是,第二个位置(B)通过Internet访问数据库。

Incase the internet at location A is down, Location B looses connection to the database. 如果位置A的Internet断开,则位置B会断开与数据库的连接。

Is it somehow possible to put another server at Location B with continous replication and following conditions:- If internet is working at Location A, then users access Location A servers only. 是否可以通过以下条件连续复制并在位置B上放置另一台服务器:-如果Internet在位置A上工作,则用户只能访问位置A的服务器。 Users can access the server available at Location B till the time internet is down at Location A. Once the connectivity is restored, both the databases can replicate. 用户可以访问位置B处的服务器,直到位置A处的互联网中断为止。恢复连接后,两个数据库都可以复制。 Incase there is any mismatch/duplicate, then Location A will be considered master and the changes would be overwritten? 如果存在任何不匹配/重复项,那么位置A将被视为主位置并且更改将被覆盖吗?

I would like to know if such a solution is possible and the problems I can face with this setup? 我想知道这样的解决方案是否可能,这种设置会遇到的问题?

MariaDB 10+ offers Galera Cluster that has Multiple Master settings. MariaDB 10+提供具有多个Master设置的Galera Cluster。 Basically all servers (in your case 3) will be masters and data to 1 server goes to the others. 基本上,所有服务器(在您的情况下为3台)都将是主服务器,其中1台服务器的数据将转给其他服务器。 If one goes down, the other servers continue. 如果其中一台发生故障,则其他服务器继续运行。 Once the server comes back up, the it syncs back the missing data. 服务器启动后,它将同步回丢失的数据。

That's the database level 那是数据库级别

For the connectivity level, you need a "load balancer" type of device which distributes the load between up machines or detects a down machine and directs to the others. 对于连接级别,您需要一种“负载平衡器”类型的设备,该设备可以在启动机器之间分配负载或检测到停机的机器并将其定向到其他机器。 They are hard to find for mysql type servers. 对于mysql类型的服务器,很难找到它们。 But .. feasible if that's your question 但是..可行的,如果那是你的问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM