On Tue, 12 Apr 2011, [email protected] wrote:

On Wed, 13 Apr 2011, Anders Synstad wrote:

On 04/13/2011 08:45 AM, [email protected] wrote:

another option you may want to consider is multicast MAC with UDP. This
allows you to have multiple machines with the same IP address on one
network. you can even use CLUSTERIP (part of iptables) to do load
balancing of inbound traffic across multiple machines. To have multiple
machines get the same traffic, configure CLUSTERIP to make each machine
think it is the only box with that IP address.


In other words, this requires more work than I'm willing to put in for my development server. It's not that important, but more of a curiosity :)

this is actually surprisingly easy. I'll try and remember to do a cut-n-paste of the configuration to do this manually and send it to you tomorrow. It's an _extremely_ powerful tool to have available.

to do this, run the following iptables command

/sbin/iptables -I INPUT -d 192.168.1.8 -i eth0 -j CLUSTERIP --new --clustermac 
01:02:03:04:05:06 --total-nodes 1 --local-node 1 --hashmode sourceip

and then configure an interface for 192.168.1.8

on debian I have this in my /etc/network/interfaces

auto eth0:0
iface eth0:0 inet static
        address 192.168.1.8
        netmask 255.255.255.0

do this on two machines on the same network and then send UDP traffic to 192.168.1.8 and both machines will get a copy

if you need to change one of the machines to a load balanced cluster, insted of saying machine 1 of 1 in the iptables line, make one 1 of 2 and the other 2 of 2 and each machine will get approximatly half the connections (since this shifts on connections, not individual packets, this is why rsyslog has the rebind options to have UDP and TCP senders periodically reopen a connection, so the new connection will be load balanced independantly of the old one. if you do this rebind a few times a second, you will get pretty even distribution between a couple of machines)

you can user heartbeat (www.linux-ha.org) to manage the clusterIP configuration so that when one box fails, the other box(s) in the cluster reconfigure themselves so that you always have _some_ box responding to all traffic

CLUSTERIP itself isn't limited to UDP, you can use it to load balance TCP connections across multiple machines, but since TCP requires two-way communications you can't use it with multiple machines recieving the same traffic (you would get exactly the same problem you ran into with the packet replication)

David Lang
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com

Reply via email to