Re: connection to backend smtp server is being reset
Roman Gelfand <[email protected]>
| Newsgroups | gmane.linux.keepalived.devel |
|---|---|
| Message-ID | <CAJbW+rmhqWvBGqbnrk_UXAi7mj0VW+3Dhjnp-mMOZXCuQJN+tg@mail.gmail.com> |
> Can you connect directly from the keepalived machine to each real server using 'telnet 192.168.0.244 25' and 'telnet 192.168.0.245 25' ?
yes
> Do you have the VIP IP address bound to the loopback address on each of the real servers (check with 'ip add show lo')?
root@pmx11:~# ip add show lo
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet 192.168.0.249/32 brd 192.168.0.255 scope global lo:249
root@pmx12:~# ip add show lo
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet 192.168.0.249/32 brd 192.168.0.255 scope global lo:249
> Do you have the following values set on each real server?
echo 2 > /proc/sys/net/ipv4/conf/lo/arp_announce
echo 1 > /proc/sys/net/ipv4/conf/lo/arp_ignore
echo 2 > /proc/sys/net/ipv4/conf/all/arp_announce
echo 1 > /proc/sys/net/ipv4/conf/all/arp_ignore
yes
I, also, installed the latest stable version and changed the config
since the previous email. Nothing helped.
root@lb1:~# ipvsadm -L -n
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP 192.168.0.249:25 rr persistent 360
-> 192.168.0.244:25 Route 1 0 0
-> 192.168.0.245:25 Route 1 0 0
There is, also, this in the log IPVS: Can't initialize ipvs: Protocol
not available
Nov 21 19:19:14 lb1 Keepalived[2577]: Starting Keepalived v1.2.9 (11/20,2013)
Nov 21 19:19:14 lb1 Keepalived[2578]: Starting Healthcheck child
process, pid=2579
Nov 21 19:19:14 lb1 Keepalived[2578]: Starting VRRP child process, pid=2580
Nov 21 19:19:14 lb1 Keepalived_vrrp[2580]: Registering Kernel netlink reflector
Nov 21 19:19:14 lb1 Keepalived_vrrp[2580]: Registering Kernel netlink
command channel
Nov 21 19:19:14 lb1 Keepalived_vrrp[2580]: Registering gratuitous ARP
shared channel
Nov 21 19:19:14 lb1 Keepalived_vrrp[2580]: Initializing ipvs 2.6
Nov 21 19:19:14 lb1 Keepalived_healthcheckers[2579]: Initializing ipvs 2.6
Nov 21 19:19:14 lb1 kernel: [ 5.538416] nf_conntrack version 0.5.0
(8023 buckets, 32092 max)
Nov 21 19:19:14 lb1 Keepalived_vrrp[2580]: IPVS: Can't initialize
ipvs: Protocol not available
Nov 21 19:19:14 lb1 Keepalived_vrrp[2580]: Opening file
'/etc/keepalived/keepalived.conf'.
Nov 21 19:19:14 lb1 Keepalived_vrrp[2580]: Configuration is using : 61430 Bytes
Nov 21 19:19:14 lb1 kernel: [ 5.546153] IPVS: Registered protocols
(TCP, UDP, SCTP, AH, ESP)
Nov 21 19:19:14 lb1 kernel: [ 5.546171] IPVS: Connection hash table
configured (size=4096, memory=64Kbytes)
Nov 21 19:19:14 lb1 kernel: [ 5.546281] IPVS: Creating netns size=2088 id=0
Nov 21 19:19:14 lb1 kernel: [ 5.546284] IPVS: ipvs loaded.
Nov 21 19:19:14 lb1 Keepalived_healthcheckers[2579]: Registering
Kernel netlink reflector
Nov 21 19:19:14 lb1 Keepalived_healthcheckers[2579]: Registering
Kernel netlink command channel
Nov 21 19:19:14 lb1 Keepalived_healthcheckers[2579]: Opening file
'/etc/keepalived/keepalived.conf'.
Nov 21 19:19:14 lb1 Keepalived_healthcheckers[2579]: Configuration is
using : 12533 Bytes
Nov 21 19:19:14 lb1 Keepalived_vrrp[2580]: Using LinkWatch kernel
netlink reflector...
Nov 21 19:19:14 lb1 Keepalived_healthcheckers[2579]: Using LinkWatch
kernel netlink reflector...
Nov 21 19:19:14 lb1 Keepalived_healthcheckers[2579]: Activating
healthchecker for service [192.168.0.245]:25
Nov 21 19:19:14 lb1 Keepalived_healthcheckers[2579]: Activating
healthchecker for service [192.168.0.244]:25
Nov 21 19:19:14 lb1 kernel: [ 5.574016] IPVS: [rr] scheduler registered.
Nov 21 19:19:14 lb1 mpt-statusd: detected non-optimal RAID status
Nov 21 19:19:15 lb1 Keepalived_vrrp[2580]: VRRP_Instance(VI_1)
Transition to MASTER STATE
Nov 21 19:19:16 lb1 Keepalived_vrrp[2580]: VRRP_Instance(VI_1)
Entering MASTER STATE
root@lb1:~# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0c:29:91:4f:8a
inet addr:192.168.0.250 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe91:4f8a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2498 errors:0 dropped:0 overruns:0 frame:0
TX packets:921 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:262390 (256.2 KiB) TX bytes:83660 (81.6 KiB)
eth0:0 Link encap:Ethernet HWaddr 00:0c:29:91:4f:8a
inet addr:192.168.0.249 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
My new config is...
global_defs {
lvs_id LVS_1
}
vrrp_instance VI_1 {
interface eth0
state MASTER
virtual_router_id 51
priority 101 # 101 on master, 100 on backup
advert_int 1
smtp_alert
authentication {
auth_type PASS
auth_pass pass
}
virtual_ipaddress {
192.168.0.249/24
}
virtual_server 192.168.0.249 25 {
delay_loop 60
lb_algo rr
lb_kind DR
protocol TCP
persistence_timeout 360
real_server 192.168.0.245 25 {
weight 1
TCP_CHECK {
connect_timeout 3
connect_port 25
nb_get_retry 3
delay_before_retry 3
}
}
real_server 192.168.0.244 25 {
weight 1
TCP_CHECK {
connect_timeout 3
connect_port 25
nb_get_retry 3
delay_before_retry 3
}
}
}
On Thu, Nov 21, 2013 at 2:49 PM, Todd Fleisher <[email protected]> wrote:
> Can you connect directly from the keepalived machine to each real server using 'telnet 192.168.0.244 25' and 'telnet 192.168.0.245 25' ?
>
> Do you have the VIP IP address bound to the loopback address on each of the real servers (check with 'ip add show lo')?
>
> Do you have the following values set on each real server?
> echo 2 > /proc/sys/net/ipv4/conf/lo/arp_announce
> echo 1 > /proc/sys/net/ipv4/conf/lo/arp_ignore
> echo 2 > /proc/sys/net/ipv4/conf/all/arp_announce
> echo 1 > /proc/sys/net/ipv4/conf/all/arp_ignore
>
> -T
>
> On Nov 20, 2013, at 11:17 AM, Roman Gelfand wrote:
>
>> I am trying to connect, from a workstation, to backend smtp server via
>> keepalived lb using command telnet 192.168.0.249 25. The connection
>> is being reset.
>>
>> trace take on machine running keepalived
>> -------------------------------------------------------------
>>
>> 90 18:28:37.116176 192.168.0.209 192.168.0.249 TCP 66 54121 > smtp
>> [SYN] Seq=0 Win=8192 Len=0 MSS=1460 WS=4 SACK_PERM=1
>> 112 18:28:43.116442 192.168.0.209 192.168.0.249 TCP 62 [TCP
>> Retransmission] 54121 > smtp [SYN] Seq=0 Win=8192 Len=0 MSS=1460
>> SACK_PERM=1
>>
>> trace taken from machine running postfix smtp server
>> ------------------------------------------------------------------------------
>>
>> 135 18:29:32.180241 192.168.0.250 192.168.0.244 TCP 74 59566 > smtp
>> [SYN] Seq=0 Win=14600 Len=0 MSS=1460 SACK_PERM=1 TSval=4616943 TSecr=0
>> WS=16
>> 136 18:29:32.180292 192.168.0.244 192.168.0.250 TCP 74 smtp > 59566
>> [SYN, ACK] Seq=0 Ack=1 Win=14480 Len=0 MSS=1460 SACK_PERM=1
>> TSval=2535443 TSecr=4616943 WS=32
>> 137 18:29:32.180435 192.168.0.250 192.168.0.244 TCP 66 59566 > smtp
>> [ACK] Seq=1 Ack=1 Win=14608 Len=0 TSval=4616943 TSecr=2535443
>> 138 18:29:32.180480 192.168.0.250 192.168.0.244 TCP 66 59566 > smtp
>> [RST, ACK] Seq=1 Ack=1 Win=14608 Len=0 TSval=4616943 TSecr=2535443
>>
>>
>> Not sure why it is not working.
>>
>>
>> my topology is as follows.
>>
>> lb1 (keepalived server) host mx... eth0 vip .249, eth1 ip .250
>> ||
>> ||
>> ||
>> ========================
>> || ||
>> || ||
>> || ||
>> host mx1... ip .244 (postfix smtp) host mx2... ip .245 (postfix smtp)
>>
>> On each m1... and mx2... mail servers I added
>>
>> My config is...
>>
>> global_defs {
>> lvs_id LVS_1
>> }
>> vrrp_instance VI_1 {
>> interface eth1
>> state MASTER
>> virtual_router_id 51
>> priority 101 # 101 on master, 100 on backup
>> advert_int 1
>> smtp_alert
>> authentication {
>> auth_type PASS
>> auth_pass pass
>>
>> }
>>
>> virtual_ipaddress {
>> 192.168.0.249/24 brd 192.168.0.255 dev eth0
>> }
>>
>> virtual_server 192.168.0.249 25 {
>> delay_loop 60
>> lb_algo rr
>> lb_kind DR
>> protocol TCP
>> persistence_timeout 360
>>
>> real_server 192.168.0.245 25 {
>> weight 1
>> TCP_CHECK {
>> connect_timeout 3
>> connect_port 25
>> nb_get_retry 3
>> delay_before_retry 3
>> }
>> }
>> real_server 192.168.0.244 25 {
>> weight 1
>> TCP_CHECK {
>> connect_timeout 3
>> connect_port 25
>> nb_get_retry 3
>> delay_before_retry 3
>> }
>> }
>> }
>>
>> ------------------------------------------------------------------------------
>> Shape the Mobile Experience: Free Subscription
>> Software experts and developers: Be at the forefront of tech innovation.
>> Intel(R) Software Adrenaline delivers strategic insight and game-changing
>> conversations that shape the rapidly evolving mobile landscape. Sign up now.
>> http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Keepalived-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/keepalived-devel
>
>
> ------------------------------------------------------------------------------
> Shape the Mobile Experience: Free Subscription
> Software experts and developers: Be at the forefront of tech innovation.
> Intel(R) Software Adrenaline delivers strategic insight and game-changing
> conversations that shape the rapidly evolving mobile landscape. Sign up now.
> http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
> _______________________________________________
> Keepalived-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/keepalived-devel
------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing
conversations that shape the rapidly evolving mobile landscape. Sign up now.
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk