LVS HA
Hi all,
I was thinking about HA and LVS on this situation:
Every packet that my LVS recives, and needs to retransmit to any Real
Server, I'd like to replicate to a Backup LVS server.
For this task, I wonder to implement in NF_PREROUTING NetFilter hook
and NF_QUEUE. I would send the packet to user space, and with a daemon on user space, I create a copy of this packet and send to another daemon on Backup LVS, while the original packet goes back to kernel space to finish its journey. So if LVS fails, the daemon on Backup LVS could reinject the pending packets on kernel again, with libipq (can this reinjection be done?) and no one(Real Servers and clients) would notice the fail.
My doubts:
- Can the reinjection be done on Backup LVS, from user space with some kernel interface? Maybe with libipq, and the same iptables queue?
- If yes, what happens with ip connection track? 'Cose we're talking about packets from an alredy established connection.
- All this crazy idea is possible? Or should I quit, and put myself on a hospital for insane people?
I'm a kernel networking (developer) beginner, so I'm kind of lost
yet. Any idea or correction will be very appreciated.
Thanks.
--
.~. Ulysses Almeida
/ V \ [email protected]
/ ( ) \ Seja livre, use GNU/Linux!
^^-^^
Quoted 8 lines · Ulysses Almeida
For this task, I wonder to implement in
NF_PREROUTINGNetFilter hook
andNF_QUEUE. I would send the packet to user space, and with a daemon on user space, I create a copy of this packet and send to another daemon on Backup LVS, while the original packet goes back to kernel space to finish its journey. So if LVS fails, the daemon on Backup LVS could reinject the pending packets on kernel again, with libipq (can this reinjection be done?) and no one(Real Servers and clients) would notice the fail.
I doubt this will give any meaningful results, or even be needed as TCP/IP is designed to handle slight packet losses by retransmission and packet loss is a normal nature of IP networking.
What you really want to have replicated is the LVS session state details on your current connections. For this there already exists LVS tools.
Quoted 3 lines
- Can the reinjection be done on Backup LVS, from user space with some kernel interface? Maybe with libipq, and the same iptables queue?
Not using libipq but you can use tun/tap. But as I said above I doubt this is something you need to bother with as the hosts already do retransmissions if needed due to packet loss.
Quoted 2 lines
- If yes, what happens with ip connection track? 'Cose we're talking about packets from an alredy established connection.
See the LVS documentation on how to syncronise LVS state tables. This is not an netfilter/iptables question and is quite well documented in LVS.
If you are using iptables NAT/conntrack then it would be a netfilter/iptables question, and work is apparently ongoing for adding session state syncronisation to iptables.
Regards
Henrik