4.6. Setting up IP address resources on AWS
To manage network access for cluster resources during failover in a high availability (HA) cluster, you can configure IP address resources. The Red Hat High Availability Add-On offers resource agents for different Amazon Web Services (AWS) IP address types.
This includes internet-exposed addresses, single-zone addresses, and multi-zone addresses.
-
Exposed to the internet: Use the
awseipnetwork resource. -
Limited to a single AWS Availability Zone (AZ): Use the
awsvipandIPaddr2network resources. Reassigns to many AWS AZs within the same AWS region: Use the
aws-vpc-move-ipnetwork resource.참고If the HA cluster does not manage any IP addresses, the resource agents for managing virtual IP addresses on AWS are not required. If you need further guidance for your specific deployment, consult with AWS.
4.6.1. Creating an IP address resource to manage an IP address exposed to the internet 링크 복사링크가 클립보드에 복사되었습니다!
To ensure that high-availability (HA) clients can access a Red Hat Enterprise Linux (RHEL) node that uses public-facing internet connections, configure an AWS Secondary Elastic IP Address (awseip) resource to use an elastic IP address.
Prerequisites
- You have a configured cluster.
- Your cluster nodes must have access to the RHEL HA repositories. For details, see Installing the High Availability packages and agents.
- You have set up the AWS CLI2. For details, see Installing AWSCLI2.
Procedure
-
Add the two resources to the same group that you have already created to enforce
orderandcolocationconstraints. Install the
resource-agentspackage:# dnf install resource-agentsCreate an elastic IP address:
[root@ip-10-0-0-48 ~]# aws ec2 allocate-address --domain vpc --output texteipalloc-4c4a2c45 vpc 35.169.153.122Optional: Display the description of
awseip. This shows the options and default operations for this agent.# pcs resource describe awseipCreate the Secondary Elastic IP address resource with the allocated IP address in the 2nd step:
# pcs resource create <resource_id> awseip elastic_ip=<elastic_ip_address> allocation_id=<elastic_ip_association_id> --group networking-groupExample:
# pcs resource create elastic awseip elastic_ip=35.169.153.122 allocation_id=eipalloc-4c4a2c45 --group networking-group
Verification
Verify the cluster status to ensure resources are available:
[root@ip-10-0-0-58 ~]# pcs statusCluster name: newcluster Stack: corosync Current DC: ip-10-0-0-58 (version 1.1.18-11.el7-2b07d5c5a9) - partition with quorum Last updated: Mon Mar 5 16:27:55 2018 Last change: Mon Mar 5 15:57:51 2018 by root via cibadmin on ip-10-0-0-46 3 nodes configured 4 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 vip (ocf::heartbeat:IPaddr2): Started ip-10-0-0-48 elastic (ocf::heartbeat:awseip): Started ip-10-0-0-48 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.Launch an SSH session from your local workstation to the elastic IP address that you have already created:
$ ssh -l ec2-user -i ~/.ssh/cluster-admin.pem 35.169.153.122- Verify that the SSH connected host is same as the host with the elastic resources.