Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I set up 2 virtual ips

global_defs {
   notification_email   {
     *@*.com
                        }
   notification_email_from *@*.com
   smtp_server *
   smtp_connect_timeout 30
   lvs_id LVS_DEVEL
            }
vrrp_instance VI_1 {
interface eth0
state MASTER
virtual_router_id 10
priority 101   # 101 on master, 100 on backup
virtual_ipaddress       {
                            10.6.10.41
                            10.6.10.48
                        }
notify_master "/etc/keepalived/notify.sh del 10.6.10.41"
notify_backup "/etc/keepalived/notify.sh add 10.6.10.41"
notify_fault "/etc/keepalived/notify.sh add 10.6.10.41"
notify_master "/etc/keepalived/notify.sh del 10.6.10.48"
notify_backup "/etc/keepalived/notify.sh add 10.6.10.48"
notify_fault "/etc/keepalived/notify.sh add 10.6.10.48"


}


virtual_server 10.6.10.41 8089{
      ! health check every 6 seconds
    delay_loop 6
      ! use round-robin for load-balancing. See the "scheduler" section
      ! of the ipvsadm man page for other algorthms
    lb_algo rr
      ! NAT connections, can also be an IP-IP tunnel (TUN) or 
      ! direct-return (DR) 
    !lb_kind NAT
    lb_kind DR
    nat_mask 255.255.255.0
      ! use persistance, timeout after 50 seconds
    persistence_timeout 50
      ! this is TCP-based service
    protocol TCP

    ! specify our real servers' IP addresses and ports
    real_server 10.6.10.46 8089 {
                                    ! should one server be weighted heavier than another?
                                    weight 1
                                    ! the health-check is a TCP connection to port 22
                                    TCP_CHECK   {
                                                    connect_port 8089
                                                    connect_timeout 3
                                                }
                                }
! real server #2...
    real_server 10.6.10.47 8089 {
                                    weight 1
                                    TCP_CHECK   {
                                    connect_port 8089
                                    connect_timeout 3
                }
                                }
}

virtual_server 10.6.10.48 162 {
    delay_loop 6
    lb_algo rr
    lb_kind DR
    nat_mask 255.255.255.0
    persistence_timeout 50
    protocol UDP

    ! specify our real servers' IP addresses and ports
    real_server 10.6.10.46 162 {
                                    weight 1
                                    MISC_CHECK  {
                                                    connect_timeout 3
                                                    misc_path "/etc/keepalived/snmptrapd_check.sh"
                                                }
                                }
! real server #2...
    real_server 10.6.10.47 162 {
                                    weight 1
                                    MISC_CHECK  {
                                                    connect_timeout 3
                                                    misc_path "/etc/keepalived/snmptrapd_check.sh"
                                                }
                                }
}

the first for one service, the second for another. when i shut down the second service the ip doesn't switch on the backup, i'm just notified that the service is down, evenv if there's' the backup server working, i receive:

kernel: IPVS: RR: no destination available

thanks in advance

Luca colombrita

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.