Centos 7 - Keepalived Linux Virtual Server is not working

345

in my case, i use LVS-DR. If you're using LVS-DR

Based on http://www.austintek.com/LVS/LVS-HOWTO/HOWTO/LVS-HOWTO.ipvsadm.html

LVS-DR, LVS-Tun: the default gw cannot be the director - use some local router.

Change the virtual address to

virtual_ipaddress {
        192.168.100.105 dev enp0s8
}

Change default gateway on your real servers to router NOT Director.

Change

lb_kind NAT 

to

lb_kind DR

Also you need to add iptables rules on real-server.

http://www.centos.org/docs/5/html/Virtual_Server_Administration/s2-lvs-direct-iptables-VSA.html

On Real Server 192.168.100.102 and 192.168.100.103

iptables -t nat -A PREROUTING -p <tcp|udp> -d <vip> --dport <port> -j REDIRECT

In this case become:

iptables -t nat -A PREROUTING -p tcp -d 192.168.100.105 --dport 8000 -j REDIRECT
Share:
345

Related videos on Youtube

Stack
Author by

Stack

Updated on September 18, 2022

Comments

  • Stack
    Stack almost 2 years

    I need to make some request to as much websites as I could, so I have a small function that generates random domain names, (I need them as 'brute force' for making requests to this domains), this is my function:

    from itertools import product
    from string import ascii_lowercase
    
    def _create_domain(self):
        return [''.join(i) for i in product(ascii_lowercase, repeat = 5)]
    

    This function returns an array of all posible 5-letter combinations, and then I use that random words to create an url. Actually the majority of this 'words' isn't real domain names ['aaaaa', 'aaaab' ....] so it's a huge waste of time make requests to all this words, but I can't think of a better way of doing this, do you think there's a more optimal way?

    • DevOps
      DevOps over 7 years
      Maybe it's out-of-scope but usually keepalived is used for moving virtual IP from one host to another. Why not using HAProxy in TCP mode here instead ?
    • Hauke Laging
      Hauke Laging about 4 years
      You have one paragraph "Machine I" and two paragraphs "Machine II". I guess the second one is supposed to be "Machine III".
    • wim
      wim over 3 years
      Why are you making requests to random domain names? Sounds spammy.
    • Stack
      Stack over 3 years
      Hahaha, it sound like that but I'm actually working on some algorithm, and instead of manually adding some domain names to make the requests, I thought that creating a function instead'll be much more interesting.