Re: Track file process script priority
Quentin Armitage <[email protected]> Mon, 27 Nov 2023 15:50:04 +0000
| Newsgroups | gmane.linux.keepalived.devel |
|---|---|
| Message-ID | <[email protected]> |
--===============4848540467082266247== Content-Type: multipart/alternative; boundary="=-E0cuvo8eUiOfBu4dDY7i" --=-E0cuvo8eUiOfBu4dDY7i Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit On Mon, 2023-11-27 at 13:34 +0100, Lynch maniac wrote: > > Thank you for this beautiful project. I have a question that I couldn't find the answer to > in the documentation. > Keepalived offers multiple ways to track who is the master and who is the slave > (track_file, track_process, track_scripts...). But how does keepalived prioritize these > trackers ? > Let me explain. If I have a value with track_file and another with track_script, what is > the priority between the two values? Do the values add up? How does Keepalived choose the > master if there are several trackers? Can you confirm that it is possible to have > track_file and track_script or track_process at the same time ? If a VRRP instance has multiple trackers, the failure of any of them will put the VRRP instance into fault state, unless the trackers have a weight, in which case the weight is added to the VRRP priority of the VRRP instance when the tracker is up. Each tracker configured against a vrrp instance will add its own weight as appropriate. So suppose a VRRP instance is configured with priority 100. track_script A has weight 10 and track_script B weight 15 Script A Script B VRRP effective priority Down Down 100 Up Down 110 Down Up 115 Up Up 125 The same principle applies for track_process, track_interface, track_file etc. The current master is determined by the systems whose VRRP instance currently has the highest effective priority (unless "no_preempt" has been configured). The VRRP master sends periodic adverts (default every second) which include the instance's current priority. If an instance on another system has a higher effective priority, unless no_preempt has been configured, the higher priority system will start sending adverts. Once the lower priority system sees the higher priority adverts, it will drop back to backup state. It is possible to have multiple of each of track_script, track_file, track_process, track_interface and track_bfd at the same time and if they have weights those weights will all be added to the effective priority as appropriate. I hope this helps, Quentin Armitage --=-E0cuvo8eUiOfBu4dDY7i Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable <html><head></head><body><div>On Mon, 2023-11-27 at 13:34 +0100, Lynch mani= ac wrote:</div><blockquote type=3D"cite" style=3D"margin:0 0 0 .8ex; border= -left:2px #729fcf solid;padding-left:1ex"><div dir=3D"ltr"><br>Thank you fo= r this beautiful project. I have a question that I couldn't find the answer= to in the documentation.<br>Keepalived offers multiple ways to track who i= s the master and who is the slave (track_file, track_process, track_scripts= ...). But how does keepalived prioritize these trackers ?<br><div>Let me ex= plain. If I have a value with track_file and another with track_script, wha= t is the priority between the two values? Do the values add up? How does Ke= epalived choose the master if there are several trackers? Can you confirm t= hat it is possible to have track_file and track_script or track_process at = the same time ?</div></div></blockquote><div><br></div><div>If a VRRP insta= nce has multiple trackers, the failure of any of them will put the VRRP ins= tance into fault state, unless the trackers have a weight, in which case th= e weight is added to the VRRP priority of the VRRP instance when the tracke= r is up. Each tracker configured against a vrrp instance will add its own w= eight as appropriate.</div><div><br></div><div>So suppose a VRRP instance i= s configured with priority 100. track_script A has weight 10 and track_scri= pt B weight 15</div><div><br></div><div>Script A<span class=3D"Apple-tab-sp= an" style=3D"white-space:pre"> </span>Script B<span class=3D"Apple-tab-span= " style=3D"white-space:pre"> </span>VRRP effective priority</div><div>Down<= span class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>Down<span c= lass=3D"Apple-tab-span" style=3D"white-space:pre"> </span>100</div><div>Up<= span class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>Down<span = class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>110</div><div>Do= wn<span class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>Up<span = class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>115</div><div>U= p<span class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>Up<span = class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>125</div><div><= br></div><div>The same principle applies for track_process, track_interface= , track_file etc.</div><div><br></div><div>The current master is determined= by the systems whose VRRP instance currently has the highest effective pri= ority (unless "no_preempt" has been configured). The VRRP master sends peri= odic adverts (default every second) which include the instance's current pr= iority. If an instance on another system has a higher effective priority, u= nless no_preempt has been configured, the higher priority system will start= sending adverts. Once the lower priority system sees the higher priority a= dverts, it will drop back to backup state.</div><div><br></div><div>It is p= ossible to have multiple of each of track_script, track_file, track_process= , track_interface and track_bfd at the same time and if they have weights t= hose weights will all be added to the effective priority as appropriate.</d= iv><div><br></div><div>I hope this helps,</div><div><br></div><div>Quentin = Armitage</div><div><span></span></div></body></html> --=-E0cuvo8eUiOfBu4dDY7i-- --===============4848540467082266247== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============4848540467082266247== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Keepalived-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/keepalived-devel --===============4848540467082266247==--