Connect and Sync 2 Mysql Databases - mysql

Is it possible to sync 2 MYSQL databases so if you write into one it will sync add it to the other one too and other way around? I've seen some Programs that you can use on your local pc but I need a script for example php that I can upload to my vps, it checks every minute for new data and syncs it.
Is that possible?

Are you tried Mysql Replication strategies? See MySQL Replication for High Availability.
Specially Master with Backup Master (Multiple Replication)
or Master with Active Master (Circular Replication or Ring topology)

Related

Looking for Mysql Backup/Sync suggestions (multiple servers syncing to 1)

I have 3 mysql servers that i need to backup daily.. each server uses just 1 database w/ multiple tables..
I've scripted a mysql dump script on each server.. but this time i want each mysql server backing up to a 4th server (MASTER SERVER) (w/c is remote location) ..
The Master server will serve as a MIRROR for all 3 servers, so that we can view the data of the other servers even if one of them goes down, because the Master server will be on a more reliable internet connection .
NOTES and LIMITATIONS:
1) EACH SERVER needs to "send" their backups to the MASTER SERVER, because the master server can not do "incoming" connection to each slave servers (port forwarding not supported on the slaves)
2) Prefer that only the "changes" are backed up to make things lighter on the network. (synchronization? incremental?)
3) All are running windows 7 at the moment, because for now i'm using Navicat MySQL's synchronization features.. I would prefer to use a PHP script based solution so i can migrate things to *nix.. i've read about replication and all that stuff, but I kinda wanted a ready solution, perhaps a software i could download or buy or something.. I've no time to code my own sync/replication scripts/software. just wana get over this remote sync hurdle and move on w/ the project.
regards to all
i've read about replication and all that stuff, but I kinda wanted a
ready solution
But replication is a ready-solution just type a few commands and change a few configuration.

Setup Magento to write on multiple mysql masters

I'm completely newbie in mysql cluster. I was trying long ours to find if, when I setup magento with mysql cluster, it will write to one of the nodes or always to one node?
My second question is, when I setup mysql replication: one master and one slave, and master server die, will magento start to write on slave, or my app stop working?
Thanks a lot!
1)
Magento supports by default: 1 master and multiple read slaves.
For specific modules you can define different read/write custom connections. So, with this setup you could write data to multiple mysql master servers.
Notice: None of the large Magento hosting partners/providers (nbs, nexcess, peer1, etc) managed to have a working solution with multiple db masters.
2) No. there is no auto switch to slave.

MySQL MASTER MASTER replication, adding a new Master with out downtime

I have setup master-master mysql replication in 2 different nodes. Suppose If i am going to add one more node, i.e 3rd master , do I need to have a exactly the same copy of the database in the new server as in the node-1 and node-2 ?
These are high traffic servers and will be keep on updating the database every seconds, so we would like to do it with out downtime. Is there any way to do this, with out downtime ?
MySQL 5.1.18, it is possible to use MySQL Cluster in multi-master replication, including circular replication between a number of MySQL Clusters.
Detailed explanation is explained here:
http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster-replication-multi-master.html

4 master server replicate to single server + 4 instances

MYSQL 5.X
i want to know how can we replicate 5 different master server to a single server having 5 DB instances in MYSQL replication. what are advantages and disadavntages.
If you know how to
configure several MySQL servers on the same machine (http://dev.mysql.com/doc/refman/5.5/en/multiple-servers.html)
configure replication between a master and a slave (http://dev.mysql.com/doc/refman/5.5/en/replication-howto.html)
then you are good to go, I believe.
What is the purpose of this replication?
If for backup purposes only, then I do not see any disadvantage, especially if you run 5 separate instances of MySQL on the backup machine.
Just make sure your hardware is fast enough to deal with the combined activity of the 5 masters.
I don't see any other useful application for this setup.

about mysql high-availability

I read some article about how to implement high-availability solution,the use Heartbeat to check the master mysql is broken,if it broken then switch to the backup server,
one question is when the master server broken,the backup server work on ,how the backup server get the master server 's pre-data
another question is maybe sometimes the master server is not broken,but the mysql service is broken,in this situation is Heartbeat still will switch to the backup server?
What you usually want to do is setup a master-master configuration, but generally only use one master. That was each master also acts as a slave to the other master. In theory, you can modify records in either one and they will keep in sync. In practice, I wouldn't do heavy updates on both servers at once.
My current setup is a master-master configuration, with each master also having a slave off of it. Then you can "failover" to the secondary master/slave and "fail back" when needed. I actually do this if I have database modifications that will take a while.