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.

Is it possible to configure keepalived in a such way?

In normal state VIP_1 assigned to SERVER_1 and VIP_2 assigned to SERVER_2

on server failure all VIP's going to working server, and after failed server becomes live we dont migrate his VIP back to him, we need to do it manual due some content-replication reasons.

configuraton atm:

#SERVER_1        
vrrp_sync_group VG1 {
        group {
          content
        }
    }


    vrrp_instance content {
        state BACKUP  
        interface eth1
        virtual_router_id 1  
        priority 100
        advert_int 1
        authentication {
            auth_type PASS
            auth_pass 1212 
        }
        virtual_ipaddress {
            192.168.100.111/24
        }
    }

    # SERVER_2

    vrrp_sync_group VG1 {
        group {
          content
        }
    }

    vrrp_instance content {
        state BACKUP  
        interface eth1
        virtual_router_id 1  
        priority 100
        advert_int 1
        authentication {
            auth_type PASS
            auth_pass 1212  
        }
        virtual_ipaddress {
            192.168.100.111/24     }
    }
share|improve this question
add comment

1 Answer 1

up vote 0 down vote accepted

On host 1:

vrrp_instance VI_1 {
    state MASTER
    interface eth0
    dont_track_primary
    virtual_router_id 1
    priority 150
    advert_int 5
    mcast_src_ip 172.16.40.1
    authentication {
        auth_type PASS
        auth_pass 1111
    }
    virtual_ipaddress {
    10.0.0.1/24 dev eth0
    }
}

vrrp_instance VI_2 {
    state BACKUP
    interface eth0
    dont_track_primary
    virtual_router_id 5
    priority 100
    advert_int 5
    mcast_src_ip 172.16.40.1
    authentication {
        auth_type PASS
        auth_pass 1111
    }
    virtual_ipaddress {
        10.0.0.2/24 dev eth0
    }
}

On host 2:

vrrp_instance VI_1 {
    state BACKUP
    interface eth0
    dont_track_primary
    virtual_router_id 1
    priority 100
    advert_int 5
    mcast_src_ip 172.16.40.2
    authentication {
        auth_type PASS
        auth_pass 1111
    }
    virtual_ipaddress {
        10.0.0.1/24 dev eth0
    }
}

vrpp_instance VI_2 {
    state MASTER
    interface eth0
    dont_track_primary
    virtual_router_id 5
    priority 150
    advert_int 5
    mcast_src_ip 172.16.40.2
    authentication {
        auth_type PASS
        auth_pass 1111
    }
    virtual_ipaddress {
        10.0.0.2/24 dev eth0
    }
}

For the no-auto-failback, look at nopreempt in the keepalived.conf man page but also see: http://article.gmane.org/gmane.linux.keepalived.devel/1537%22

share|improve this answer
    
errm, can't correct IPs instead of blah blah blah sections in your answer, always get 2 IPs on same server. can you make more detailed configuration? –  Denis Feb 28 '13 at 12:30
    
Updated with sample RFC 1918 addresses on dev eth0 10.0.0.1 is primary on VIP on host1, 10.0.0.2 is for host2. Failover is bidirectional. See note about about nopreempt but use BACKUP for initial states for all VIPs. –  dmourati Feb 28 '13 at 17:43
    
thanks a lot for help :) –  Denis Mar 1 '13 at 8:02
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.