Results 1 to 5 of 5

Thread: how to sync two mysql databases?

  1. #1
    Join Date
    Nov 2005
    Posts
    2

    Question how to sync two mysql databases?

    Hello everyone,

    I have a small problem ahead of me. I run a hosting company and am going to start offering syncing services to my clients. I am going to use DNS failover to monitor the main server and if that should go down, kick it over to the secondary server for minimal downtime.

    I will also be using rsync to update the necessary files to the second server.

    My question is, how would I go about setting something up that would automatically sync the necessary mysql databases?

    Here's how it would work right now:

    1. I would modify the necessary config file for the rsync script to include the customers who paid for the service. It will only sync those accounts. These accounts are located in /home/acctname
    2. The mysql dbs are located at /var/lib/mysql folder (you probably knew that), so, I could use rsync to just copy them over, but the hardest part is to actually apply the updates to the databases on the second server. How can I go about doing this?

    Thanks for any help!

  2. #2
    Join Date
    Dec 2002
    Location
    Cape Town, South Africa
    Posts
    75
    Hi

    Does MySQL replication (http://www.databasejournal.com/featu...le.php/3355201) not do what you need?

  3. #3
    Join Date
    Nov 2005
    Posts
    2
    Thanks for the link. I'll check it out.

  4. #4
    Join Date
    Sep 2005
    Posts
    5

    synchronization and replication

    Have a look at the program SQLyog at www.webyog.com.

    Also read this:
    http://www.webyog.com/faq/10_60_en.html

  5. #5
    Join Date
    Nov 2005
    Posts
    2

    Hey

    It appears that you want a failover feature.

    MySQL offers:

    Replication: setup two hosts (1 master & 1 slave). All data is written to the master and the slave replicates the data. Now if the master fails, the slave does NOT take over, but you do have a copy of all your data unharmed.
    (You could create a few simple shell scripts where if the IP of the master fails, have the slave change IP address...)
    http://dev.mysql.com/doc/refman/5.0/en/replication.html

    Clustering: setup 3 or more hosts (1 server to manage the cluster, 1 master and 1 node). All data is written to the master then to the slave. If the master fails then the node automatically takes over.
    http://dev.mysql.com/doc/refman/5.0/en/ndbcluster.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •