4.6.2. Creating an IP address resource to manage a private IP address limited to a single AWS Availability Zone
In an Amazon Web Services (AWS) Availability Zone (AZ), you can use a private IP address. This address is limited to that zone in a Red Hat Enterprise Linux (RHEL) high-availability (HA) cluster. Use this address to configure an AWS Secondary Private IP Address (awsvip) resource.
Prerequisites
- You have a configured cluster.
- Your cluster nodes have access to the RHEL HA repositories. For details,see Installing the High Availability packages and agents.
- You have set up the AWS CLI. For details, see Installing AWSCLI2.
Procedure
Install the
resource-agentspackage.# dnf install resource-agentsOptional: View the options and default operations for
awsvip:# pcs resource describe awsvipCreate a Secondary Private IP address with an unused private IP address in the
VPC CIDRblock:[root@ip-10-0-0-48 ~]# pcs resource create privip awsvip secondary_private_ip=10.0.0.68 --group networking-groupThe secondary private IP address is included in a resource group.
Create a virtual IP resource with the
vipresource ID and thenetworking-groupgroup name:root@ip-10-0-0-48 ~]# pcs resource create vip IPaddr2 ip=10.0.0.68 --group networking-groupA Virtual Private Cloud (VPC) IP address maps from the fence node to the failover node and masks the failure of the fence node within the subnet. Ensure that the virtual IP belongs to the same resource group as the Secondary Private IP address you created in the previous step.
Verification
Verify the cluster status to ensure resources are available:
[root@ip-10-0-0-48 ~]# pcs status Cluster name: newcluster Stack: corosync Current DC: ip-10-0-0-46 (version 1.1.18-11.el7-2b07d5c5a9) - partition with quorum Last updated: Fri Mar 2 22:34:24 2018 Last change: Fri Mar 2 22:14:58 2018 by root via cibadmin on ip-10-0-0-46 3 nodes configured 3 resources configured Online: [ ip-10-0-0-46 ip-10-0-0-48 ip-10-0-0-58 ] Full list of resources: clusterfence (stonith:fence_aws): Started ip-10-0-0-46 Resource Group: networking-group privip (ocf::heartbeat:awsvip): Started ip-10-0-0-48 vip (ocf::heartbeat:IPaddr2): Started ip-10-0-0-58 Daemon Status: corosync: active/disabled pacemaker: active/disabled pcsd: active/enabledIn this example,
newclusteris an active cluster where resources such asvipandelasticare part of thenetworking-groupresource group.