keepalived weights and priority

"Bukhari, Zahid" <[email protected]>
Newsgroups gmane.linux.keepalived.devel
Message-ID <B965B9C83F174744A41D29A9632AE9650151017867@ORD-EXDB101.corp.valueclick.com>
Hello,

I'm having issues with weights and priority and failover.

I have:

master (priority 100)
backup (priority 50)

There are two check scripts and a notify script.

chk1 weight of 60 interval of 60.
chk2 weight of -255 fall 1 rise 1

The VRRP instance has track_script in there with both of the scripts.  within "track_script" there's no weight assigned since I did it with vrrp_script.

The backup has a nopreempt clause because the default priority of the master shouldn't make it fail back.

What is happening is that first - it just doesn't fail over when the chk1 script fails.  I gave that a positive weight since that will determine if it's should be point whereas chk2 makes sure that you can actually fail over to that host.

I was under the impression within a vrrp_script, if you have a positive weight, then a success will add that to the priority of the vrrp_instance.  If you have a negative weight, then it will subtract that from the priority of the vrrp_instance.

I am using Red Hat 7 with keepalved 1.2.13-6.

Thank you for any information.
-- 

Zahid Bukhari

Senior UNIX / Linux Systems Operations Engineer







This email and any files included with it may contain privileged,
proprietary and/or confidential information that is for the sole use
of the intended recipient(s).  Any disclosure, copying, distribution,
posting, or use of the information contained in or attached to this
email is prohibited unless permitted by the sender.  If you have
received this email in error, please immediately notify the sender
via return email, telephone, or fax and destroy this original transmission
and its included files without reading or saving it in any manner.
Thank you.

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e

_______________________________________________
Keepalived-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/keepalived-devel
keepalived-master.conf (text/plain, 1.4 KB)
# Managed by Puppet
vrrp_script kad_check_bubs_sender {
  script    "/usr/local/bin/kad_check_bubs_sender.sh"
  interval  60
  weight    60
}

vrrp_script kad_check_bubs {
  script    "/usr/local/bin/kad_check_bubs.sh"
  interval  60
  weight    -255
  fall      1
  rise      1
}

global_defs {
  notification_email {
    [email protected]
  }
  smtp_server localhost
  smtp_connect_timeout 5
  router_id shorthostmaster
}

vrrp_instance VI_bubs_99 {
  interface                 p1p1
  state                     MASTER
  virtual_router_id         99
  priority                  100
  advert_int                1
  garp_master_delay         5
  smtp_alert



  # notify scripts and alerts are optional
  #
  # filenames of scripts to run on transitions
  # can be unquoted (if just filename)
  # or quoted (if has parameters)


  # for ANY state transition.
  # "notify" script is called AFTER the
  # notify_* script(s) and is executed
  # with 3 arguments provided by keepalived
  # (ie don't include parameters in the notify line).
  # arguments
  # $1 = "GROUP"|"INSTANCE"
  # $2 = name of group or instance
  # $3 = target state of transition
  #     ("MASTER"|"BACKUP"|"FAULT"|"STOP")
  notify /usr/local/bin/kad_notify.sh


  authentication {
    auth_type AH
    auth_pass K@D_bubs_99
  }

  track_script {
    kad_check_bubs_sender
    kad_check_bubs
  }


  virtual_ipaddress {
    10.110.108.99 dev p1p1
  }





}
keepalived-backup.conf (text/plain, 1.4 KB)
# Managed by Puppet
vrrp_script kad_check_bubs_sender {
  script    "/usr/local/bin/kad_check_bubs_sender.sh"
  interval  60
  weight    60
}

vrrp_script kad_check_bubs {
  script    "/usr/local/bin/kad_check_bubs.sh"
  interval  60
  weight    -255
  fall      1
  rise      1
}

global_defs {
  notification_email {
    [email protected]
  }
  smtp_server localhost
  smtp_connect_timeout 5
  router_id shorthostbackup
}

vrrp_instance VI_bubs_99 {
  interface                 p1p1
  state                     BACKUP
  virtual_router_id         99
  priority                  50
  advert_int                1
  garp_master_delay         5
  smtp_alert
  nopreempt



  # notify scripts and alerts are optional
  #
  # filenames of scripts to run on transitions
  # can be unquoted (if just filename)
  # or quoted (if has parameters)


  # for ANY state transition.
  # "notify" script is called AFTER the
  # notify_* script(s) and is executed
  # with 3 arguments provided by keepalived
  # (ie don't include parameters in the notify line).
  # arguments
  # $1 = "GROUP"|"INSTANCE"
  # $2 = name of group or instance
  # $3 = target state of transition
  #     ("MASTER"|"BACKUP"|"FAULT"|"STOP")
  notify /usr/local/bin/kad_notify.sh


  authentication {
    auth_type AH
    auth_pass K@D_bubs_99
  }

  track_script {
    kad_check_bubs_sender
    kad_check_bubs
  }


  virtual_ipaddress {
    10.110.108.99 dev p1p1
  }





}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.