Find the answer to your Linux question:
Results 1 to 3 of 3
I am attempting to mirror MySQL databases from a master server to a secondary server. I followed this tutorial ( How To Set Up Database Replication In MySQL | HowtoForge ...
  1. #1
    Linux Newbie
    Join Date
    Feb 2007
    Location
    USA
    Posts
    221

    MySQL Database Replication with Rysnc

    I am attempting to mirror MySQL databases from a master server to a secondary server. I followed this tutorial (How To Set Up Database Replication In MySQL | HowtoForge - Linux Howtos and Tutorials) but was not successful.

    So I was wondering if this idea would work:

    Is it possible to achieve MySQL database replication by mirroring the directory that MySQL resides on the master server to the MySQL directory on the secondary server with rysnc?

    -Mike
    Suse Linux Enterprise Server 11
    Suse Linux Enterprise Server 10 - SP3
    OpenSuse 11.2, KDE 4.3.1

  2. #2
    Linux Guru
    Join Date
    Nov 2007
    Posts
    1,695
    No. There are multiple levels of caching involved with how DB's work. Rsync'ing the filesystem data from one machine to another does not guarantee the DB data is flushed/consistent.

    You can A) stop MySQL, run rsync, and then start MySQL again or B) run a MySQL DB dump to disk and rsync/copy/FTP/whatever that dump to another server.

    Google found a much newer replication tutorial made by the MySQL Dev's from 2008 dealing with MySQL 5.1.
    Last edited by HROAdmin26; 11-30-2009 at 10:45 PM.

  3. #3
    Linux Newbie
    Join Date
    Nov 2007
    Location
    Planet Earth
    Posts
    152
    It's possible only if you turn down the mysql server on both machines before start the sync. I tested with a little customer with several point of sales and works fine. That's not the most elegant solution, but do the job ... anyway, I recommend the mysql replication schema to avoid bandwidth waste.
    EOF

Posting Permissions

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