Sample Header Ad - 728x90

Request to virtual ip is not forwarding while trying IP Failover using keepalived on centos 7

0 votes
1 answer
1037 views
I am trying to test IP failover using keepalived on centos 7. I have three instances of centos 7 installed on my vm. So I have 3 servers. I am trying to run keepalived on two of them, 3rd centos will be acting as a real server where request will be forwarded to. The configuration of the keepalived is given at the end. In conf file 192.168.10.40 is the ip address of the real server. On real server I just have a small nodejs server running which replies as success when request is sent. When I sent request to nodejs server directly at 192.168.10.40:3869. It replies, But when I try to reach it using virtual ip 192.168.10.100 and port 3869, It does not reply. Although keepalived on both servers is working fine. On master server
Vrrp_instance_pi1 {
state MASTER
	interface enp0s8
	virtual_router_id 102
	priority 101
	authentication {
    	auth_type PASS
    	auth_pass 1234
	}
	virtual_ipaddress {
    	192.168.10.100/24
	}
}
virtual_server 192.168.10.100 3869 {
	delay_loop 10
	lb_algo rr
	lb_kind DR
	persistence_timeout 9600


	real_server 192.168.10.40 3869 {
    	weight 1
    	TCP_CHECK {
      	connect_timeout 20
      	connect_port	80
    	}
	}
                                                                                         
}
On backup server
Vrrp_instance_pi1 {
state BACKUP
	interface enp0s8
	virtual_router_id 102
	priority 99
	authentication {
    	auth_type PASS
    	auth_pass 1234
	}
	virtual_ipaddress {
    	192.168.10.100/24
	}
}
virtual_server 192.168.10.100 3869 {
	delay_loop 10
	lb_algo rr
	lb_kind DR
	persistence_timeout 9600


	real_server 192.168.10.40 3869 {
    	weight 1
    	TCP_CHECK {
      	connect_timeout 20
      	connect_port	80
    	}
	}
                                                                                         
}
Asked by Muhammad Saleem (3 rep)
Dec 13, 2020, 01:17 PM
Last activity: Dec 13, 2020, 04:34 PM