The problem in the Haproxy+Keepalived script


 
Thread Tools Search this Thread
Operating Systems Linux The problem in the Haproxy+Keepalived script
# 1  
Old 09-04-2016
The problem in the Haproxy+Keepalived script

Hi
Install HAPROXY+KEEPALIVED in the hosts ip
Code:
192.168.10.241

&
Code:
 192.168.20.241

And was configured as follows:
KeepAlived
Code:
vrrp_script chk_haproxy {
  script "pidof haporxy" # check the haproxy process
  interval 2 # every 2 seconds
  weight 2 # add 2 points if OK
}

vrrp_instance VI_1 {
    state MASTER
    interface eth0
    virtual_router_id 10
    priority 100
advert_int 1
    authentication {
        auth_type PASS
        auth_pass newpassword
    }
    virtual_ipaddress {
        192.168.10.25324 dev eth0
    }
  track_script {
    chk_haproxy
  }

The rest of the configuration file is the default mode
And other script I gave the form configuration
192.168.20.241
Code:
backend app
    balance     roundrobin
    server  app1 192.168.20.242:80 check
    server  app2 192.168.20.243:80 check
    server  app3 192.168.10.242:80 check
    server  app4 192.168.10.243:80 check

192.168.10.241
Code:
backend app
    balance     roundrobin
    server  app1 192.168.20.242:80 check
    server  app2 192.168.20.243:80 check
    server  app3 192.168.10.242:80 check
    server  app4 192.168.10.243:80 check

192.168.10.241
Code:
vrrp_script chk_haproxy {
  script "pidof haporxy" # check the haproxy process
  interval 2 # every 2 seconds
  weight 2 # add 2 points if OK
}

vrrp_instance VI_1 {
    state MASTER
    interface eth0
    virtual_router_id 10
    priority 101
advert_int 1
    authentication {
        auth_type PASS
        auth_pass newpassword
    }
    virtual_ipaddress {
        192.168.10.25324 dev eth0
    }
  track_script {
    chk_haproxy
  }

Configuration file sysctl
Code:
sysctl -p
net.ipv4.ip_nonlocal_ind = 1
net.ipv4.ip_forward = 1
net.ipv4.conf.default.rp_filter = 0
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmn = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296

192.168.20.241
Code:
ip a
1: lo: <LOOPACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
    linkloopack 00:00:00:00:00:00 rd 00:00:00:00:00:00
    inet 127.0.0.18 scope host lo
    inet6 ::1128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <ROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    linkether 00:0c:29:90:d3:98 rd ff:ff:ff:ff:ff:ff
    inet 192.168.20.24124 rd 192.168.20.255 scope gloal eth0
    inet 192.168.10.25324 scope gloal eth0
    inet6 fe80::20c:29ff:fe90:d39864 scope link
       valid_lft forever preferred_lft forever

192.168.10.241
Code:
ip a
 ip a
1: lo: <LOOPACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
    linkloopack 00:00:00:00:00:00 rd 00:00:00:00:00:00
    inet 127.0.0.18 scope host lo
    inet6 ::1128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <ROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    linkether 00:0c:29:74:e:8 rd ff:ff:ff:ff:ff:ff
    inet 192.168.10.24124 rd 192.168.10.255 scope gloal eth0
    inet 192.168.10.25332 scope gloal eth0
    inet6 fe80::20c:29ff:fe74:e864 scope link
       valid_lft forever preferred_lft forever

Virtual IP in 192.168.10.241
Works well

but in 192.168.20.241 Does not work

Code:
iptales stop
selinux disabled

The two networks that are connected y intranet
excuse me It was longSmilie
please help me

Last edited by jim mcnamara; 09-04-2016 at 09:26 AM.. Reason: Remove extraneous formatting
# 2  
Old 09-05-2016
Easier to ask!
In two network connected by VPN
Ihave Two itemes ha by keepalive
The problem is when i set virtual ip in network range frist network dont see that this problem just for virtual ip 2 networks ping together ...
Login or Register to Ask a Question

Previous Thread | Next Thread

2 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Keepalived and Source Hash Scheduling

Hello guys, Hope you are doing great!! Right now I'm using keepalived daemon in order to ensure a Load Balancing function between my two servers. First of all, I tried using the famous "Round-Robin Scheduling" algorithm and it worked well, but I'm kind of obligated to use the "Source Hashing ... (7 Replies)
Discussion started by: biks93
7 Replies

2. UNIX and Linux Applications

Haproxy SSL

I have a single SSL eg. www.abc.com. Im trying to get haproxy to accept any request eg. xyz.com or ijk.com to redirect to https://www.abc.com. Is this possible? #--------------------------------------------------------------------- # main frontend for XXX which proxys to the backends... (0 Replies)
Discussion started by: timmywong
0 Replies
Login or Register to Ask a Question