Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Oct 2005 12:47:51 +0200 (CEST)
From:      Oliver Fromme <olli@lurza.secnetix.de>
To:        freebsd-amd64@FreeBSD.ORG, freebsd-net@FreeBSD.ORG
Subject:   Re: How to best set-up a small local 'sync' network next to the live network?
Message-ID:  <200510051047.j95Alp81091128@lurza.secnetix.de>
In-Reply-To: <43439F3B.1040903@axis.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

(This doesn't seem to be AMD64-specific, so I think it
should be moved to the -net mailing list.)

Olaf Greve <o.greve@axis.nl> wrote:
 > [Setting up two machines with fall-back]
 > 
 > Primary server:
 > - Runs FreeBSD 5.4-Release AMD64
 > - Connected to outside world via NIC 1 @ a real IP address; say 
 > 123.45.67.89, publicly available as webserver incl. DNS mappings, etc.
 > - Connected via a cross-wire cable to fall-back machine via NIC 2 ; 
 > using address 192.168.1.1
 > 
 > Fall-back server:
 > - Runs FreeBSD 5.2.1-Release i386
 > - Connected to outside world via NIC 1 @ a real IP address; say 
 > 123.45.67.88, "privately" available by IP address only (mainly for SSH 
 > access, serves as fall-back and staging machine)
 > - Connected via a cross-wire cable to primary server machine via NIC 2 ; 
 > using address 192.168.1.2
 > 
 > [...]
 > -How can I best set-up such a dual network configuration, such that one 
 > network will not interfere with the other?

You machines have different IP addresses, so there is no
conflict.  It should work fine.

 > -Can I somehow 'force' the machines to automatically interpret anything 
 > in the 192.168.1.x range to be local, and hence automatically use NIC 2, 
 > instead of using the NIC 1 adapter (which handles my outside world traffic)?

That will happen automatically.  When you ifconfig an IP on
your NIC 2, it will automatically add an appropriate route
for that subnet on that NIC.

 > -Is it sufficient to set-up the Rsync daemon on the primary machine to 
 > only allow connections from 192.168.1.2, and to run as root, such that I 
 > can easily use the cross-wire as a kind of direct tunnel to perform the 
 > syncing?

Yes.  You should make sure that rsync is blocked on the
outside interfaces (using IPFW, IPFilter or PF).

Personally I don't think that rsync is the best way to
perform such a mirror.  There are other possibilities.
But if you prefer rsync, it should work.

 > -What is the nicest MySQL replication mechanism? Presently I use a 
 > mechanism that dumps the MySQL DB instances, and will then push them 
 > over an SSH tunnel to the fall-back machine, directly loading them into 
 > the MySQL DB on that machine. Is MySQL's master-slave syncing perhaps a 
 > better choice?

My personal recommendation is to use PostgreSQL 8.  Its
WAL logging feature is very well suited to synchronize
one or more slave machines, and it's rock stable and
fast.

However, if you application is Mysql-specific and cannot
easily be ported to PostgreSQL, then I'm afraid that wasn't
the answer you expected.  :-)   Mysql supports some sort
of replication, too, though.

Best regards
   Oliver

-- 
Oliver Fromme,  secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing
Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.

"... there are two ways of constructing a software design:  One way
is to make it so simple that there are _obviously_ no deficiencies and
the other way is to make it so complicated that there are no _obvious_
deficiencies."        -- C.A.R. Hoare, ACM Turing Award Lecture, 1980



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200510051047.j95Alp81091128>