Here we will discuss how to switch between nodes using Route53 by creating a DNS entry that points to the active node.
Record Set on Route 53 to be Created
node-a | A-IPv4 Address | 10.20.1.10 |
node-b | A-IPv4 Address | 10.20.2.10 |
node-active | A-IPv4 Address | 10.20.1.10 (same as node-a) |
Create a Hosted Zone
First, you need a Hosted Zone (this should look like a DNS domain such as example.com).
- On the AWS management console, go to Route53.
- Select Hosted Zone.
- Select “Create Hosted Zone”.
- Enter the following values:
Domain | test.local |
Type | Private hosted zone |
VPC Association | Select region and name of VPC (e.g., LK-VPC) |
- The Hosted Zone is now created. At this point, there are only two entries (NS & SOA) created.
- To connect from another VPC, the other VPC must be associated.
Go to the VPC settings and ensure that these two values are set to enabled.
Create Entries on the Hosted Zone
- Create records as shown below:
- Confirm the hosts can be resolved by name.
Create an IP Resource
Now you can create an IP resource. Note that the IP address of the resource has to be an active node (the IP address of node-active.test.cl: 10.20.1.10). Refer to Creating an IP Resource for more information. Once the IP address of the active node (10.20.1.10) has been selected, the “IP Resource Tag” field is set to “realip” and the IP address of node-b (secondary) is set to 10.20.2.10 (the actual IP address of the second node). Those are automatically selected by selecting the “realip” id for the first node.
Once the IP resource is created, the LifeKeeper User Interface should look like this.
Assign Permission to Update Route 53 Entries to Instances
To allow LifeKeeper (running on the EC2 Instance) to update a Route53 entry, the instance must have roles that allow DNS updates.
- route53:ListHostedZones
- route53:GetChange
- route53:ChangeResourceRecordSets
- route53:ListResourceRecordSets
To achieve this, create a policy like the one seen below (note that it may be necessary to limit the resources that may be accessed), then assign it to a Role.
Once a Role is defined, assign it to these EC2 Instances.
Create the Route53 Resource
Creating the Route53 Resource should be straightforward once we have created the IP Resource.
- Select Route53 as Recovery Kit.
- For required settings, enter the domain name, local host name, and corresponding Virtual IP resource. Then click Next.
Domain Name | test.local |
Host Name | node-active |
Domain Name (Route53 hosted zone) | test.local |
- For the additional settings, select a resource tag and Switchback type. In this guide, the defaults are used. Then click Next.
Switchback Type | Intelligent |
Route53 Resource Tag | reoute53-node-active |
- Review the settings provided and when ready, click “Execute”
Server | node-a |
Application Recovery Kit | Amazon Route53 |
Domain Name (Route53 hosted zone) | test.local |
Host Name | node-active |
IP Resource | realip-eth0 |
Route53 Resource Tag | reoute53-node-active |
Switchback Type | Intelligent |
- Once the resource Hierarchy is created, click on “Extend Resource Hierarchy”.
- When prompted to select options for extending the resource hierarchy, use the default options. Then click Next.
Template Server | node-a |
Template Priority | 1 |
Target Server | node-b |
Target Priority | 10 |
- Once the “Pre-Extend Checks” succeed, click “Next”.
- For additional Settings, select “Intelligent” for switchback type, and select the route53 resource created in steps 1-4. Then click “Next”.
Switchback Type | Intelligent |
Resource | route53-node-active |
- Review the selected options, then click “Execute” when ready to proceed.
Template Server | node-a |
Resource | route53-node-active |
Template Priority | 1 |
Target Server | node-b |
Target Priority | 10 |
Switchback Type | Intelligent |
Resource | route53-node-active |
- The Route53 resource is now created as shown below.
Notice that realip is located under route53-node-active. This indicates that the “route53-node-active” resource depends on the “realip” resource.
Post your comment on this topic.