Displaying present location in the site.

We Tried Building an HA Cluster Using the Multi-Attach Feature of Amazon EBS (Windows/Linux)

EXPRESSCLUSTER Official Blog

December 2nd, 2021

Machine translation is used partially for this article. See the Japanese version for the original article.

Introduction

The Multi-Attach feature (hereinafter called "Multi-Attach") is available that allows you to attach Amazon Elastic Block Store (hereinafter called "EBS") volumes to multiple Amazon Elastic Compute Cloud (hereinafter called "EC2"). This time, we tried building a shared disk type HA cluster on Amazon Web Services (hereinafter called "AWS") using EBS Multi-Attach.

Previously, before Multi-Attach was released, it was not possible to build a shared disk type HA cluster with EXPRESSCLUSTER X on AWS.
However, by using Multi-Attach, it is now possible to build a shared disk type HA cluster. We will introduce how to build it.

Contents

1. What is Amazon EBS Multi-Attach?

EBS Multi-Attach allows you to attach to multiple EC2 instances in Single-AZ by setting the Multi-Attach option for EBS in provisioned IOPS (io1 or io2). The volume types that can enable the multi-attach feature vary by region. Please check thepopupAWS official website for details.

Previously, it was only possible to attach to a single EC2 instance, so it could not be treated as a disk connected to multiple EC2 instances, such as a shared disk.
From now on, however, multi-attach allows EBS to be treated like shared disks.

EXPRESSCLUSTER X shared disk clusters are an option in environments where I/O performance is important because there is no write performance degradation associated with synchronizing of I/O data, such as mirror disk clusters.

EBS multi-attach provides these benefits, but the application must maintain the write order to ensure that the data in EBS is consistent.
If you write data from multiple EC2 instances without controlling the writes, the data may appear to be written correctly at first glance, but you may actually be destroying the file system.

Therefore, it is necessary to take measures such as controlling EC2 instances that can write data, such as EXPRESSCLUSTER X disk resources (shared disk control resources).

2. Shared Disk Type HA Cluster Configuration

In this case, we built a "shared disk type HA cluster" in the N. Virginia region environment, and confirmed that EBS attached to multiple EC2 instances can be controlled by disk resources.

In this configuration, a two-node shared disk type HA cluster is built, and the instance that can access EBS with multi-attach enabled is switched by the disk resource that controls the shared disk.

The configuration is as follows:

architecture

EBS is attached to both nodes, but is accessible only from the nodes where disk resources are running (the active EC2 in the case of figure) due to disk resource control.
EBS cannot be referenced or written from the standby EC2.

If the active EC2 fails, the disk resource is activated in the standby EC2, and the EBS can be referenced and written from the standby EC2.

Client can access to business applications without having to be aware of which node is being launched by specifying a virtual IP address controlled by AWS Virtual IP Resources.

3. Procedure for Building a Shared Disk HA Cluster

Basically, it can be built in the same procedure as the procedure for building a shared disk type cluster described in the EXPRESSCLUSTER X manual.
We tried with the following network configuration.

N. Virginia Region

  • VPC
  • CIDR:10.0.0.0/16
  • Subnet
  • Subnet-A1 (Public) :10.0.10.0/24
  • Subnet-A2 (Private):10.0.110.0/24
  • Instance(Windows)
  • active EC2:10.0.110.100
  • standby EC2:10.0.110.101
  • Instance(Linux)
  • active EC2:10.0.110.200
  • standby EC2:10.0.110.201

3.1 Prepare EBS with Multi-Attach enabled

  • 1.In the AWS Management Console (hereinafter called "Management Console"), select "Create volume" from menu of Elastic Block Store -> Volumes
  • 2.Select "Provisioned IOPS SSD (io2)" in Volume type, and set desired values for the Size and IOPS. For the Availability Zone, specify the Availability Zone in which you want to build EC2.
  • 3.Check the checkbox of "Enable Multi-Attach", and create the volume.

3.2 Building a Shared Disk Type HA Cluster (Windows)

The following is the procedure for building a shared disk type HA cluster in a Windows environment.
We added the following resources to EXPRESSCLUSTER X 4.3 for Windows (internal version 12.30) and checked the operation.

  • EXPRESSCLUSTER

  • Group resources
  • Disk resource
  • AWS virtual ip resource
  • Monitor resources
  • Disk TUR monitor resource
  • AWS virtual ip monitor resource
  • User mode monitor resource
  • Heartbeat Resources
  • Kernel mode LAN heartbeat resource
  • Witness heartbeat resources
  • Network partition resolution resources
  • DISK network partition resolution resource
  • HTTP network partition resolution resource
The following drive letters are assigned to related resources on shared disks:
resource Drive letter
DISK network partition resolution resource D:\
Disk resource E:\

3.2.1 EBS Settings for Shared Disks (Windows)

Create partitions on EBS for use as a shared disk. For details, please refer to the Installation and Configuration Guide.
you can begin by the following procedure and also attach and detach EBS on the management console.

  • 1.Attach the multi-attach enabled EBS (simply referred to as EBS in the following steps) that you created in section 3.1 to the active EC2.
  • 2.Create a partition (D:) for disk heartbeat on EBS disk from Disk Management, etc on the active EC2. Formatting is not required.
  • 3.Create a switchable partition (E:) for disk resources on EBS disk and format it with NTFS on the active EC2.
  • 4.Detach EBS from the active EC2.
  • 5.Attach EBS to the standby EC2.
  • 6.Confirm if the drive letters of EBS match the drive letters you created on the active EC2 from Disk Management, etc on the standby EC2. If they are different, set the drive letters to match.
  • 7.Detach EBS from the standby EC2.
[Reference]
  • Manuals > EXPRESSCLUSTER X > EXPRESSCLUSTER X 4.3 for Windows > Installation and Configuration Guide

  •  
  • 2. Determining a system configuration
  • 2.6 Setting after configuring hardware
  • 2.6.1 Shared disk settings (Required for shared disk)

3.2.2 Installing EXPRESSCLUSTER X (Windows)

To install EXPRESSCLUSTER X, follow these steps:

  • 1.Attach EBS to the active EC2.
  • 2.Install EXPRESSCLUSTER X on the active EC2. During installation, select the EBS adapter in the shared disk filtering settings window and set the filtering.
    Also, register a license if necessary.

     

     

  • 3.Detach the EBS from the active EC2 after shutting down the OS.
  • 4.Attach EBS to the standby EC2.
  • 5.Install EXPRESSCLUSTER X on the standby EC2. During installation, select the EBS adapter in the shared disk filtering settings windows and set the filtering.
    Also, register a license if necessary.

     

     

  • 6.Reboot the standby EC2.

     

  • 7.Attach EBS to the active EC2 and start it.

Filtering settings for EBS for shared disks

[Reference]
  • Manuals > EXPRESSCLUSTER X > EXPRESSCLUSTER X 4.3 for Windows > Installation and Configuration Guide

  •  
  • 4. Installing EXPRESSCLUSTER
  • 4.2 Installing EXPRESSCLUSTER Server
  • 4.2.1 Installing the EXPRESSCLUSTER Server for the first time

3.2.3 Building HA Clusters with EXPRESSCLUSTER X (Windows)

Launch Cluster WebUI using a web browser on the client server to access the active EC2.

In the procedure for building each control (VIP/EIP/DNS name) described in the Configuration guide, replace the settings for mirror disk resources with the settings for (shared) disk resources as appropriate, and create the cluster. After creating the cluster configuration data, apply the configuration data on the servers that constitute a cluster and start the cluster.

[Reference]
popupDocumentation - Setup Guides
  • Windows > Cloud > Amazon Web Services

3.3 Building a Shared Disk type HA Cluster (Linux)

This procedure is used to build a shared disk HA cluster in a Linux environment.
We added the following resources to EXPRESSCLUSTER X 4.3 for Linux (internal version 4.3.0-1) to confirm operation.

  • EXPRESSCLUSTER

  • Group resources
  • Disk resource
  • AWS virtual ip resource
  • Monitor resources
  • Disk TUR monitor resource
  • AWS virtual ip monitor resource
  • User mode monitor resource
  • Heartbeat Resources
  • Kernel mode LAN heartbeat resource
  • Disk heartbeat resource
  • Witness heartbeat resources
  • Network partition resolution resources
  • HTTP network partition resolution resource

Related resources on shared disks are assigned the following partition names:

Resource Partition name
Disk heartbeat resources /dev/nvme1n1p1
Disk resource /dev/nvme1n1p2

3.3.1 EBS Settings for Shared Disks (Linux)

Create a partition on EBS for use as a shared disk. For details, please refer to the Installation and Configuration Guide.you can begin by the following procedure and also attach and detach EBS on the management console.

  • 1.Attach the multi-attach enabled EBS (simply referred to as EBS in the following steps) that you created in section 3.1 to the active EC2 and standby EC2.
  • 2.Create a partition (/dev/nvme1n1p1) on the EBS disk using fdisk and parted commands, etc on the active EC2.

     

  • 3.Create and format a switchable partition (/dev/nvme1n1p2) for disk resources on the EBS disk on the active EC2.

     

     

  • 4.Create a mount point (/mnt/sd1, etc.) on the active EC2.
  • 5.Confirm on standby EC2 that the partition information of the EBS of the active EC2 matches that of the standby EC2 using fdisk and parted commands, etc.
  • 6.Create a mount point (/mnt/sd1, etc.) on the standby EC2.

     

     

[Reference]
  • Manuals > EXPRESSCLUSTER X > EXPRESSCLUSTER X 4.3 for Linux > Installation and Configuration Guide

  •  
  • 2. Determining a system configuration
  • 2.6 Setting after configuring hardware
  • 2.6.1 Shared disk settings for disk resource (Required for disk resource)

3.3.2 Installing EXPRESSCLUSTER X (Linux)

To install EXPRESSCLUSTER X, follow these steps:

  • 1. Install EXPRESSCLUSTER X on the active EC2, register a license if necessary, and then reboot the active EC2.
  • 2. Install EXPRESSCLUSTER X on the standby EC2, register a license if necessary, and then reboot the standby EC2.

[Reference]
  • Manuals > EXPRESSCLUSTER X > EXPRESSCLUSTER X 4.3 for Linux > Installation and Configuration Guide

  •  
  • 4. Installing EXPRESSCLUSTER
  • 4.2 Setting up the EXPRESSCLUSTER Server

3.3.3 Building HA Clusters with EXPRESSCLUSTER X (Linux)

Launch Cluster WebUI using a web browser on the client server to access the active EC2.

In the procedure for building each control (VIP/EIP/DNS name) described in the Configuration guide, replace the settings for mirror disk resources with the settings for (shared) disk resources as appropriate, and create the cluster. After creating the cluster configuration data, apply the configuration data on the servers that constitute a cluster and start the cluster.

[Reference]
popupDocumentation - Setup Guides
  • Linux > Cloud > Amazon Web Services

4. Checking the Operation

Before and after failover, verify that access to the shared disk is in place and that data is being taken over.

  • 1.Start failover group in the active EC2.

     

     

  • 2.Verify that you can access the switchable partition (E:\for Windows, /mnt/sd1 for Linux, etc.) on the active EC2.
    Also, verify that the switchable partition cannot be accessed from the standby EC2.

     

     

     

  • 3.Create a test.txt in the switchable partition on the active EC2.
  • 4.Move failover group to the standby EC2 manually and check on the Cluster WebUI that the group has been started on the moving destination EC2.
  • 5.Verify that you can access the switchable partition on the standby EC2.
    Also, verify that the switchable partition cannot be accessed from the active EC2.
6. Confirm that test.txt appears in the switchable partition and that you can open it with an editor on the standby EC2.

We have confirmed that the data has been taken over.

Conclusion

We tried to build a shared disk type HA cluster using EBS Multi-Attach function.
If you have a desire to build a shared-disk HA cluster on AWS, please try it.

If you consider introducing the configuration described in this article, you can perform a validation with thepopuptrial module of EXPRESSCLUSTER. Please do not hesitate to contact us if you have any questions.