Re: keepalived on CentOS - UDP port question

Richard Scott <[email protected]> Thu, 24 Nov 2016 13:28:58 +0000
Newsgroups gmane.linux.keepalived.announce
Message-ID <[email protected]>
--===============2856182303571114356==
Content-Type: multipart/alternative;
	boundary="=_a444b29093763256991f18d1d155cbbd"

--=_a444b29093763256991f18d1d155cbbd
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII

Hi, 

See if manually running this helps: 

ipvsadm --set 0 0 90 

That sets UDP timeouts 90 sec. 

Hope that helps, 

Rich

On 24/11/2016 10:38, Thomas Spiessens wrote:

> Hi, 
> I have a problem with keepalived not allowing UDP communication to continue longer than about 20-30 seconds. I have two servers on which keepalived is running (version 1.2.13-7.el7 on CentOS 7.1) and for which keepalived is managing a virtual IP address. Below is the keepalived.conf for one server (10.65.101.3) which checks that port 1026 is available. This port will only be available on one of the two servers, hence that server will get the virtual IP address. With this configuration, UDP communication on port 1025 seems to be failing shortly after restarting the keepalived service. This can be seen by the tshark trace from that server. IP 10.65.101.194 should be sending an UDP packet every second to 10.65.101.204:1025 [1]. After about 22 packets (in this case), it stops. I have also ad
 ded an additional section to the configuration file which can also be seen below, but this did not help. Anyone have an idea why this is happening ? 
> 
> Kind regards, 
> Thomas. 
> 
> KEEPALIVED.CONF 
> vrrp_script chk_flux_scada_1 { 
> script "</dev/tcp/10.65.101.3/1026 [2]" 
> interval 5 
> weight 2 
> } 
> 
> vrrp_instance flux_scada_1 { 
> state BACKUP 
> interface enp16s0f0 
> virtual_router_id 2 
> priority 100 
> advert_int 1 
> garp_master_delay 1 
> authentication { 
> auth_type PASS 
> auth_pass flux_scada_1 
> } 
> virtual_ipaddress { 
> 10.65.101.204/24 [3] 
> } 
> notify_master "/opt/tmsflux/bin/tmsflux.sh vipchg 10.65.101.204" 
> dont_track_primary 
> track_interface { 
> enp16s0f0 weight 2 
> } 
> track_script { 
> chk_flux_scada_1 
> } 
> } 
> 
> TSHARK TRACE 
> 
> [root@nec03 tmsflux]# tshark -i enp16s0f0 | grep 10.65.101.194 
> Running as user "root" and group "root". This could be dangerous. 
> Capturing on 'enp16s0f0' 
> 209 675 0.603264894 10.65.101.194 -> 10.65.101.204 UDP 71 Source port: blackjack  Destination port: blackjack 
> 855 877 1.603166155 10.65.101.194 -> 10.65.101.204 UDP 71 Source port: blackjack  Destination port: blackjack 
> 1631 1750 2.603071785 10.65.101.194 -> 10.65.101.204 UDP 71 Source port: blackjack  Destination port: blackjack 
> 1920 1921 3.602926368 10.65.101.194 -> 10.65.101.204 UDP 71 Source port: blackjack  Destination port: blackjack 
> 2804 2802 4.602978992 10.65.101.194 -> 10.65.101.204 UDP 71 Source port: blackjack  Destination port: blackjack 
> 3049 3028 5.602730339 10.65.101.194 -> 10.65.101.204 UDP 71 Source port: blackjack  Destination port: blackjack 
> 3930 3919 6.602575707 10.65.101.194 -> 10.65.101.204 UDP 71 Source port: blackjack  Destination port: blackjack 
> 4006 4125 7.602456663 10.65.101.194 -> 10.65.101.204 UDP 71 Source port: blackjack  Destination port: blackjack 
> 4420 5013 8.602439187 10.65.101.194 -> 10.65.101.204 UDP 71 Source port: blackjack  Destination port: blackjack 
> 5096 5182 9.602249722 10.65.101.194 -> 10.65.101.204 UDP 71 Source port: blackjack  Destination port: blackjack 
> 5597 6053 10.602128231 10.65.101.194 -> 10.65.101.204 UDP 71 Source port: blackjack  Destination port: blackjack 
> 6245 6245 11.602052556 10.65.101.194 -> 10.65.101.204 UDP 71 Source port: blackjack  Destination port: blackjack 
> 7047 7036 12.601950789 10.65.101.194 -> 10.65.101.204 UDP 71 Source port: blackjack  Destination port: blackjack 
> 7121 7206 13.601855779 10.65.101.194 -> 10.65.101.204 UDP 71 Source port: blackjack  Destination port: blackjack 
> 7440 8014 14.601632708 10.65.101.194 -> 10.65.101.204 UDP 71 Source port: blackjack  Destination port: blackjack 
> 8168 8268 15.601568155 10.65.101.194 -> 10.65.101.204 UDP 71 Source port: blackjack  Destination port: blackjack 
> 8498 9035 16.601527362 10.65.101.194 -> 10.65.101.204 UDP 71 Source port: blackjack  Destination port: blackjack 
> 9235 9328 17.601420998 10.65.101.194 -> 10.65.101.204 UDP 71 Source port: blackjack  Destination port: blackjack 
> 9607 10085 18.601245518 10.65.101.194 -> 10.65.101.204 UDP 71 Source port: blackjack  Destination port: blackjack 
> 10269 10353 19.601174646 10.65.101.194 -> 10.65.101.204 UDP 71 Source port: blackjack  Destination port: blackjack 
> 10651 11123 20.601081274 10.65.101.194 -> 10.65.101.204 UDP 71 Source port: blackjack  Destination port: blackjack 
> 11334 11419 21.600983814 10.65.101.194 -> 10.65.101.204 UDP 71 Source port: blackjack  Destination port: blackjack 
> 11730 12165 22.600841343 10.65.101.194 -> 10.65.101.204 UDP 71 Source port: blackjack  Destination port: blackjack 
> 27749 
> 
> KEEPALIVED.CONF - ADDITIONAL SECTION 
> 
> virtual_server 10.65.101.204 1025 { 
> protocol UDP 
> 
> real_server 10.65.101.2 { 
> TCP_CHECK { 
> connect_port 1026 
> } 
> } 
> 
> real_server 10.65.101.3 { 
> TCP_CHECK { 
> connect_port 1026 
> } 
> } 
> } 
> 
> ------------------------------------------------------------------------------ 
> _______________________________________________
> Keepalived-announce mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/keepalived-announce
 

Links:
------
[1] http://10.65.101.204:1025
[2] http://10.65.101.3/1026
[3] http://10.65.101.204/24
--=_a444b29093763256991f18d1d155cbbd
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=UTF-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; charset=
=3DUTF-8" /></head><body style=3D'font-size: 10pt; font-family: Verdana,Gen=
eva,sans-serif'>
<p>Hi,</p>
<p>See if manually running this helps:</p>
<p><span style=3D"font-family: courier new,courier,monospace;">ipvsadm --se=
t 0 0 90</span></p>
<p>That sets UDP timeouts 90 sec.</p>
<p>Hope that helps,</p>
<p>Rich</p>
<div>&nbsp;</div>
<p><br /></p>
<p>On 24/11/2016 10:38, Thomas Spiessens wrote:</p>
<blockquote type=3D"cite" style=3D"padding: 0 0.4em; border-left: #1010ff 2=
px solid; margin: 0"><!-- html ignored --><!-- head ignored --><!-- meta ig=
nored -->
<div dir=3D"ltr">Hi,
<div>I have a problem with keepalived not allowing UDP communication to con=
tinue longer than about 20-30 seconds. I have two servers on which keepaliv=
ed is running (version 1.2.13-7.el7 on CentOS 7.1) and for which keepalived=
 is managing a virtual IP address. Below is the keepalived.conf for one ser=
ver (10.65.101.3) which checks that port 1026 is available. This port will =
only be available on one of the two servers, hence that server will get the=
 virtual IP address. With this configuration, UDP communication on port 102=
5 seems to be failing shortly after restarting the keepalived service. This=
 can be seen by the tshark trace from that server. IP 10.65.101.194 should =
be sending an UDP packet every second to <a href=3D"http://10.65.101.204:10=
25">10.65.101.204:1025</a>. After about 22 packets (in this case), it stops=
=2E I have also added an additional section to the configuration file which=
 can also be seen below, but this did not help. Anyone have an idea why thi=
s is happening ?</div>
<div>&nbsp;</div>
<div>Kind regards,</div>
<div>Thomas.</div>
<div>&nbsp;</div>
<div>
<div><strong>keepalived.conf</strong></div>
<div>&nbsp; &nbsp; vrrp_script chk_flux_scada_1 {</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; script "&lt;/dev/tcp/<a href=3D"http://10=
=2E65.101.3/1026">10.65.101.3/1026</a>"</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; interval 5</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; weight 2</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; }</div>
<div>&nbsp;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; vrrp_instance flux_scada_1 {</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; state BACKUP</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; interface enp16s0f0</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; virtual_router_id 2</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; priority 100</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; advert_int 1</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; garp_master_delay 1</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; authentication {</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; auth_type PASS</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; auth_pass flux_scada_1</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; }</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; virtual_ipaddress {</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href=3D"http://10.65.101=
=2E204/24">10.65.101.204/24</a></div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; }</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; notify_master "/opt/tmsflux/bin/tmsflux.sh=
 vipchg 10.65.101.204"</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; dont_track_primary</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; track_interface {</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; enp16s0f0 weight 2</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; }</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; track_script {</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; chk_flux_scada_1</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; }</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; }</div>
</div>
<div>&nbsp;</div>
<div><strong>tshark trace</strong></div>
<div>
<div>[root@nec03 tmsflux]# tshark -i enp16s0f0 | grep 10.65.101.194</div>
<div>Running as user "root" and group "root". This could be dangerous.</div=
>
<div>Capturing on 'enp16s0f0'</div>
<div>209 675 0.603264894 10.65.101.194 -&gt; 10.65.101.204 UDP 71 Source po=
rt: blackjack &nbsp;Destination port: blackjack</div>
<div>855 877 1.603166155 10.65.101.194 -&gt; 10.65.101.204 UDP 71 Source po=
rt: blackjack &nbsp;Destination port: blackjack</div>
<div>1631 1750 2.603071785 10.65.101.194 -&gt; 10.65.101.204 UDP 71 Source =
port: blackjack &nbsp;Destination port: blackjack</div>
<div>1920 1921 3.602926368 10.65.101.194 -&gt; 10.65.101.204 UDP 71 Source =
port: blackjack &nbsp;Destination port: blackjack</div>
<div>2804 2802 4.602978992 10.65.101.194 -&gt; 10.65.101.204 UDP 71 Source =
port: blackjack &nbsp;Destination port: blackjack</div>
<div>3049 3028 5.602730339 10.65.101.194 -&gt; 10.65.101.204 UDP 71 Source =
port: blackjack &nbsp;Destination port: blackjack</div>
<div>3930 3919 6.602575707 10.65.101.194 -&gt; 10.65.101.204 UDP 71 Source =
port: blackjack &nbsp;Destination port: blackjack</div>
<div>4006 4125 7.602456663 10.65.101.194 -&gt; 10.65.101.204 UDP 71 Source =
port: blackjack &nbsp;Destination port: blackjack</div>
<div>4420 5013 8.602439187 10.65.101.194 -&gt; 10.65.101.204 UDP 71 Source =
port: blackjack &nbsp;Destination port: blackjack</div>
<div>5096 5182 9.602249722 10.65.101.194 -&gt; 10.65.101.204 UDP 71 Source =
port: blackjack &nbsp;Destination port: blackjack</div>
<div>5597 6053 10.602128231 10.65.101.194 -&gt; 10.65.101.204 UDP 71 Source=
 port: blackjack &nbsp;Destination port: blackjack</div>
<div>6245 6245 11.602052556 10.65.101.194 -&gt; 10.65.101.204 UDP 71 Source=
 port: blackjack &nbsp;Destination port: blackjack</div>
<div>7047 7036 12.601950789 10.65.101.194 -&gt; 10.65.101.204 UDP 71 Source=
 port: blackjack &nbsp;Destination port: blackjack</div>
<div>7121 7206 13.601855779 10.65.101.194 -&gt; 10.65.101.204 UDP 71 Source=
 port: blackjack &nbsp;Destination port: blackjack</div>
<div>7440 8014 14.601632708 10.65.101.194 -&gt; 10.65.101.204 UDP 71 Source=
 port: blackjack &nbsp;Destination port: blackjack</div>
<div>8168 8268 15.601568155 10.65.101.194 -&gt; 10.65.101.204 UDP 71 Source=
 port: blackjack &nbsp;Destination port: blackjack</div>
<div>8498 9035 16.601527362 10.65.101.194 -&gt; 10.65.101.204 UDP 71 Source=
 port: blackjack &nbsp;Destination port: blackjack</div>
<div>9235 9328 17.601420998 10.65.101.194 -&gt; 10.65.101.204 UDP 71 Source=
 port: blackjack &nbsp;Destination port: blackjack</div>
<div>9607 10085 18.601245518 10.65.101.194 -&gt; 10.65.101.204 UDP 71 Sourc=
e port: blackjack &nbsp;Destination port: blackjack</div>
<div>10269 10353 19.601174646 10.65.101.194 -&gt; 10.65.101.204 UDP 71 Sour=
ce port: blackjack &nbsp;Destination port: blackjack</div>
<div>10651 11123 20.601081274 10.65.101.194 -&gt; 10.65.101.204 UDP 71 Sour=
ce port: blackjack &nbsp;Destination port: blackjack</div>
<div>11334 11419 21.600983814 10.65.101.194 -&gt; 10.65.101.204 UDP 71 Sour=
ce port: blackjack &nbsp;Destination port: blackjack</div>
<div>11730 12165 22.600841343 10.65.101.194 -&gt; 10.65.101.204 UDP 71 Sour=
ce port: blackjack &nbsp;Destination port: blackjack</div>
<div>27749</div>
</div>
<div>&nbsp;</div>
<div><strong>keepalived.conf - additional section</strong></div>
<div>
<div>virtual_server 10.65.101.204 1025 {</div>
<div><span class=3D"Apple-tab-span" style=3D"white-space: pre;"> </span>pro=
tocol UDP</div>
<div>&nbsp;</div>
<div><span class=3D"Apple-tab-span" style=3D"white-space: pre;"> </span>rea=
l_server 10.65.101.2 {</div>
<div><span class=3D"Apple-tab-span" style=3D"white-space: pre;"> </span>TCP=
_CHECK {</div>
<div><span class=3D"Apple-tab-span" style=3D"white-space: pre;"> </span>con=
nect_port 1026</div>
<div><span class=3D"Apple-tab-span" style=3D"white-space: pre;"> </span>}</=
div>
<div><span class=3D"Apple-tab-span" style=3D"white-space: pre;"> </span>}</=
div>
<div>&nbsp;</div>
<div><span class=3D"Apple-tab-span" style=3D"white-space: pre;"> </span>rea=
l_server 10.65.101.3 {</div>
<div><span class=3D"Apple-tab-span" style=3D"white-space: pre;"> </span>TCP=
_CHECK {</div>
<div><span class=3D"Apple-tab-span" style=3D"white-space: pre;"> </span>con=
nect_port 1026</div>
<div><span class=3D"Apple-tab-span" style=3D"white-space: pre;"> </span>}</=
div>
<div><span class=3D"Apple-tab-span" style=3D"white-space: pre;"> </span>}</=
div>
<div>}</div>
</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>
<div>&nbsp;</div>
</div>
</div>
<br />
<div class=3D"pre" style=3D"margin: 0; padding: 0; font-family: monospace">=
---------------------------------------------------------------------------=
---</div>
<br />
<div class=3D"pre" style=3D"margin: 0; padding: 0; font-family: monospace">=
_______________________________________________<br /> Keepalived-announce m=
ailing list<br /> <a href=3D"mailto:[email protected]=
=2Enet">[email protected]</a><br /> <a href=3D"http=
s://lists.sourceforge.net/lists/listinfo/keepalived-announce" rel=3D"norefe=
rrer">https://lists.sourceforge.net/lists/listinfo/keepalived-announce</a><=
/div>
</blockquote>
</body></html>

--=_a444b29093763256991f18d1d155cbbd--



--===============2856182303571114356==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------

--===============2856182303571114356==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Keepalived-announce mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/keepalived-announce

--===============2856182303571114356==--