Keepalived, pour faire de la HA :-)


Keepalived utilise LVS. Il est donc important de comprendre comment il fonctionne.

Get infos

LVS nous permet de récupérer différentes infos:
# Display current/active setup.
ipvsadm -l 

# The list command with this option will list current IPVS connections.
ipvsadm -l -c -n

# The list command with this option will display the  timeout values (in seconds) for TCP sessions, TCP sessions after receiving a FIN packet, and UDP packets.
ipvsadm -l --timeout

# The list command with this option will display the statistics information of services and their servers.
ipvsadm -l --stats -n

# The list command with this option will display the rate information (such as connections/second, bytes/second and packets/second) of services and their servers.
ipvsadm -l --rate -n

# The list command with this option will display the upper/lower connection threshold information of each server in service listing.
ipvsadm -l  -n  --thresholds

# The list command with this option will display the persistent connection counter information of each server in service listing. The  persistent  connection is used to forward the actual connections from the same client/network to the same server.
ipvsadm -l  -n  --persistent-conn

#The list command with this option will display the daemon status and its multicast interface.
ipvsadm -l  -n  --daemon


Une petite liste de liens à lire suivit de quelques tutoriels:


Liste des options

There is a list below of all options. This list was extracted from the keepalived-1.2.13 source code. I have to do that as the official man page is completely deprecated (at least on CentOS 7). If you want to have the proper documentation, better to check out their GitHub. The list below:
~/temp/keepalived-1.2.13$ grep -R "install_keyword(\"" . | awk '{print $1 " "$2}' | sed 's/install_keyword("//' | sed 's/",//' | sed 's@./keepalived/@@' | sed 's/.c: /\t/' | sort | uniq | column -t 
check/check_api     bind_port
check/check_api     bindto
check/check_api     connect_ip
check/check_api     connect_port
check/check_api     connect_timeout
check/check_api     fwmark
check/check_http    delay_before_retry
check/check_http    digest
check/check_http    HTTP_GET
check/check_http    nb_get_retry
check/check_http    path
check/check_http    SSL_GET
check/check_http    status_code
check/check_http    url
check/check_http    warmup
check/check_misc    MISC_CHECK
check/check_misc    misc_dynamic
check/check_misc    misc_path
check/check_misc    misc_timeout
check/check_misc    warmup
check/check_parser  alpha
check/check_parser  ca
check/check_parser  certificate
check/check_parser  delay_loop
check/check_parser  ha_suspend
check/check_parser  hysteresis
check/check_parser  inhibit_on_failure
check/check_parser  key
check/check_parser  lb_algo
check/check_parser  lb_kind
check/check_parser  lthreshold
check/check_parser  lvs_method
check/check_parser  lvs_sched
check/check_parser  nat_mask
check/check_parser  notify_down
check/check_parser  notify_up
check/check_parser  omega
check/check_parser  ops
check/check_parser  password
check/check_parser  persistence_granularity
check/check_parser  persistence_timeout
check/check_parser  protocol
check/check_parser  quorum
check/check_parser  quorum_down
check/check_parser  quorum_up
check/check_parser  real_server
check/check_parser  sorry_server
check/check_parser  sorry_server_inhibit
check/check_parser  uthreshold
check/check_parser  virtualhost
check/check_parser  weight
check/check_smtp    connect_timeout
check/check_smtp    delay_before_retry
check/check_smtp    helo_name
check/check_smtp    host
check/check_smtp    retry
check/check_smtp    SMTP_CHECK
check/check_smtp    warmup
check/check_tcp     TCP_CHECK
check/check_tcp     warmup
core/global_parser  enable_traps
core/global_parser  notification_email
core/global_parser  notification_email_from
core/global_parser  plugin_dir
core/global_parser  router_id
core/global_parser  smtp_connect_timeout
core/global_parser  smtp_server
core/global_parser  vrrp_mcast_group4
core/global_parser  vrrp_mcast_group6
vrrp/vrrp_parser    advert_int
vrrp/vrrp_parser    authentication
vrrp/vrrp_parser    auth_pass
vrrp/vrrp_parser    auth_type
vrrp/vrrp_parser    debug
vrrp/vrrp_parser    dont_track_primary
vrrp/vrrp_parser    fall
vrrp/vrrp_parser    garp_master_delay
vrrp/vrrp_parser    garp_master_refresh
vrrp/vrrp_parser    global_tracking
vrrp/vrrp_parser    group
vrrp/vrrp_parser    interface
vrrp/vrrp_parser    interval
vrrp/vrrp_parser    lvs_sync_daemon_interface
vrrp/vrrp_parser    mcast_src_ip
vrrp/vrrp_parser    native_ipv6
vrrp/vrrp_parser    nopreempt
vrrp/vrrp_parser    notify
vrrp/vrrp_parser    notify_backup
vrrp/vrrp_parser    notify_fault
vrrp/vrrp_parser    notify_master
vrrp/vrrp_parser    notify_stop
vrrp/vrrp_parser    preempt
vrrp/vrrp_parser    preempt_delay
vrrp/vrrp_parser    priority
vrrp/vrrp_parser    rise
vrrp/vrrp_parser    script
vrrp/vrrp_parser    smtp_alert
vrrp/vrrp_parser    state
vrrp/vrrp_parser    timeout
vrrp/vrrp_parser    track_interface
vrrp/vrrp_parser    track_script
vrrp/vrrp_parser    unicast_peer
vrrp/vrrp_parser    unicast_src_ip
vrrp/vrrp_parser    use_vmac
vrrp/vrrp_parser    virtual_ipaddress
vrrp/vrrp_parser    virtual_ipaddress_excluded
vrrp/vrrp_parser    virtual_router_id
vrrp/vrrp_parser    virtual_routes
vrrp/vrrp_parser    vmac_xmit_base
vrrp/vrrp_parser    weight
Page last modified on February 10, 2016, at 10:21 PM EST