Welcome to Docs Associates!

Configure keepalived.conf

Your primary Linode is set up. It has a public IP address, a private one, and Keepalived is installed. Your standby is also ready. It also has Keepalived installed, it has its own private IP address and you've given it permission to share your primary's public IP. But, there's no communication between them yet. We'll tackle that now by setting up configuration files for Keepalived on both the primary and standby.

Line Description
`vrrp_instance` This identifies the virtual instance and gives it a name. We're using `VI_1` in this example. Use a meaningful name value to help with identification. The name also needs to be _the same_ for all <> in your scenario. So, use it for your primary and both standbys. You'd also need to use it again if you add future standbys.
`virtual_router_id` This lets you group your <>s using an integer as an identifier. This needs to be _the same_ for all <>s that exist in a single high availability scenario. So, use the same number for all three.
`priority` This determines which <> has priority over another in the event of a failover. _The higher the number, the higher the priority_. So, you'll want your primary to be a higher value than both of your standbys. If you want standby #1 to have a higher priority, set its value at least one higher than the value you set for standby #2.
`advert_int` This is the broadcast frequency. In this example, 1 indicates that <> will broadcast a heartbeat every second. A heartbeat is a message that tells other <> that it's up and running. The lower the value, the quicker the failover response. But, you want to strike a balance between fast failovers and not flooding the network with unnecessary communication.
`authentication` This block determines how <> authenticates heartbeats. Set it to `auth_type AH` to use authentication headers instead of plain authentication. <> will authenticate the sender and recognize any changes in data during transmission. This can prevent an outsider from injecting bad heartbeats into the network.
`unicast_src_ip` Replace **IP** with the private IP address for the <>, where this `keepalived.conf` file lives.
`unicast_peer` This contains the private IP addresses for any of the peer <>s in your scenario. It tells <> where the other <>s are in your high availability scenario. So, this is how it would be applied in this scenario: - **On the primary**. The IP addresses for both standby #1 and standby #2. - **On standby #1**. The IP addresses for the primary and standby #2. - **On standby #2**. The IP addresses for the primary and standby #1.
`virtual_ipaddress` This is the _public_ IP address you set for your primary, that you've also shared with standby #1 and standby #2.