Re: Mirroring Solution

From: Eric W. Bates (ericx_at_vineyard.net)
Date: 06/12/03

  • Next message: Mark Bojara: "QoS for FreeBSD"
    To: "Scott Gerhardt" <scott@g-it.ca>
    Date: Thu, 12 Jun 2003 13:57:16 -0400
    
    
    


    ----- Original Message -----
    From: "Scott Gerhardt" <scott@g-it.ca>
    To: <freebsd-isp@freebsd.org>
    Sent: Saturday, June 07, 2003 2:46 PM
    Subject: Mirroring Solution


    >
    > Does anyone know of a good way to mirror two servers running Apache, PHP and
    > MySQL on FreeBSD 4.8?
    >
    > The ideal solution would be real-time (synchronous) or near-real-time
    > mirroring. The failover transfer is already taken care of.
    >
    > I think Rsync run from cron would do a good job of syncing the relatively
    > static files (configs, php scripts etc.). I don't think Rsync would be a
    > good way of mirroring the MySQL DB though. For that, I'm thinking of using
    > MySQL's built in replication.

    You are correct. Syncing live mysql data files is a bad idea. At any given instant they cannot really be considered to be in a consistent state because so much information is in memory. If you want to physically copy files, mysqlhotcopy does a pretty good job. However, we have found that using replication (v 4's circular replication is a big improvement) allows us to run mysqlhotcopy on the backup machine rather than the live one (we do a hot dump every 15 minutes). If you have to restore from tape, you will need a dump.

    NB: replication is clear-text. (the mysql v4 docs say "no ssl for replication yet") We use stunnel to obscure things.

    There is a problem with rsync when the list of files to replicate grows too long. We never really nailed it down; but if you attempt to rsync /usr, it will probably fail. What we see is the sending version of rsync eventually timing out while waiting for the receiving copy; meanwhile the receiving copy ends up hung with no visible errors. Our work-around was a little meta script with a config file listing which trees should be synced between which machines; and it runs smaller rsync jobs in sequence. Oddly enough, we ran into similar failure modes with rdist and unison.

    > I think dumping the MySQL data and importing into the slave would be a bit
    > clumsy and slow especially when the DB grows quite large.
    >
    > Does anyone on the list have any recommendations or experience with
    > mirroring of this type?
    >
    > Any other recommendations besides Rsync + MySQL replication?
    >
    >
    >
    > Thanks,
    >
    >
    > --
    > Scott Gerhardt, P.Geo.
    > Gerhardt Information Technologies [G-IT]
    >
    >
    > _______________________________________________
    > freebsd-isp@freebsd.org mailing list
    > http://lists.freebsd.org/mailman/listinfo/freebsd-isp
    > To unsubscribe, send any mail to "freebsd-isp-unsubscribe@freebsd.org"
    >

    
    

    _______________________________________________
    freebsd-isp@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-isp
    To unsubscribe, send any mail to "freebsd-isp-unsubscribe@freebsd.org"


  • Next message: Mark Bojara: "QoS for FreeBSD"

    Relevant Pages

    • Re: V440, Solaris 9 and me
      ... > I will be compiling all the above software (except MySQL) with gcc ... > across some posts that suggested that Solaris 9 does not run on the ... given that internal mirroring can only be done on ... > disk 2 ...
      (comp.unix.solaris)
    • Re: V440, Solaris 9 and me
      ... > This server will support a single customer with a single focus: ... lose MySQL in favour of Postgres. ... why WOULDN'T you use Solaris 9? ... given that internal mirroring can only be done on ...
      (comp.unix.solaris)
    • V440, Solaris 9 and me
      ... and MySQL. ... onboard Ultra 3 SCSI controller has built-in hardware mirroring (and ... one pair of drives, how should I configure the remaining two drives. ... Apache on the other as apache 1.3.x is not multi-threaded. ...
      (comp.unix.solaris)
    • Mirroring Solution
      ... MySQL on FreeBSD 4.8? ... I think Rsync run from cron would do a good job of syncing the relatively ... static files (configs, php scripts etc.). ... good way of mirroring the MySQL DB though. ...
      (freebsd-isp)
    • Re: IS replication REALLY the way to go?
      ... We support both Asyncronous or Syncronous mirroring. ... Even storage based syncronous replication ... system is if you turn on data compression. ... and apply a new snapshot to the subscriber. ...
      (microsoft.public.sqlserver.replication)