Top
PRIMECLUSTER Installation and Administration Guide4.6 Cloud Services
FUJITSU Software

21.10.1 Building Cluster Application for Network Takeover

This section describes how to create the definition file and build the cluster application to use the architectural pattern selected in "20.2.1 Network Takeover."

21.10.1.1 Creating Definition File

For network takeover, create the following definition file on all nodes controlling the network devices of AWS.

/usr/opt/reliant/etc/hvawsconfig

Information

When you create the /usr/opt/reliant/etc/hvawsconfig file, you can use the /usr/opt/reliant/etc/hvawsconfig.template file as a template.

# cp -p /usr/opt/reliant/etc/hvawsconfig.template /usr/opt/reliant/etc/hvawsconfig

Note

  • Create the hvawsconfig file with a root user and change the permission to 600.

  • The hvawsconfig file must be the same contents on each cluster node.

The contents of the definition file depend on the selected architectural pattern.

Definition file for network takeover by the virtual router

To update the routes of the virtual router, the ID information of the device managed by AWS is required.

Check each ID in AWS described in the definition file (/usr/opt/reliant/etc/hvawsconfig) with the AWS Management Console.

Information in the definition file
KeyName Mode CFNameX InstanceID RouteTableID TakeoverIPaddress ENIID [ProfileName]

Item

Contents

Remarks

KeyName

Describe the ID up to 16 letters and numbers. KeyName is case-sensitive.

This key name is defined in each script that is registered when setting the Cmdline resource. Specify the same KeyName for the paired operational system and standby system and define a KeyName for other systems to avoid duplicate names. This key name is specified as an argument to register a script when setting Cmdline resources explained later.

-

Mode

Specify the architectural pattern for network takeover.

For network takeover by the virtual router, specify the string of ROUTE or route.

-

CFNameX

Specify the CF node name.

-

InstanceID

Specify the instance ID of AWS on which the cluster host is operating.

Check with the AWS Management Console

RouteTableID

Specify the route table ID.

Check with the AWS Management Console

TakeoverIPaddress

Takeover IP address (Specify by IPv4 address.)

-

ENIID

Specify ENIID of the network interface that takes over the IP.

Check with the AWS Management Console

ProfileName

Specify the profile name of the credentials used with the AWS Command Line Interface configured in "21.3 Presetting."

When it is omitted, the device operates with the default profile.

-

Example

The takeover IP address is 172.31.0.10, and the profile name of the credentials used with the AWS Command Line Interface is userprofile1.

CmdR01 ROUTE node1 i-xxxxxxxx rtb-xxxxxxxx 172.31.0.10 eni-xxxxxxxx userprofile1
CmdR01 ROUTE node2 i-yyyyyyyy rtb-xxxxxxxx 172.31.0.10 eni-yyyyyyyy userprofile1

For multiple controls such as the mutual standby configuration, separate KeyNames and add the same contents.

The following is an example when both 172.31.0.10 and 172.32.0.10 are controlled as the takeover IP address.

CmdR01 ROUTE node1 i-xxxxxxxx rtb-xxxxxxxx 172.31.0.10 eni-xxxxxxxx userprofile1
CmdR01 ROUTE node2 i-yyyyyyyy rtb-xxxxxxxx 172.31.0.10 eni-yyyyyyyy userprofile1
CmdR02 ROUTE node1 i-xxxxxxxx rtb-xxxxxxxx 172.32.0.20 eni-aaaaaaaa userprofile1
CmdR02 ROUTE node2 i-yyyyyyyy rtb-xxxxxxxx 172.32.0.20 eni-bbbbbbbb userprofile1

Note

  • Use one line per node, separated by spaces.

  • For InstanceID and ENIID, enter the ID information of the operational system and the standby system.

  • The takeover IP address must be specified as an IPv4 address, not a host name.

  • If the settings are not correct, the routing information cannot be updated correctly, resulting in a resource failure.

Definition file for network takeover by replacing the Elastic IP address

To associate an Elastic IP with ENIID, the ID information of the device managed by AWS is required.

Check each ID in AWS described in the definition file (/usr/opt/reliant/etc/hvawsconfig) with the AWS Management Console.

Information in the definition file
KeyName Mode CFNameX InstanceID AllocationID ENIID [ProfileName]

Item

Contents

Remarks

KeyName

Describe the ID up to 16 letters and numbers. KeyName is case-sensitive.

This key name is defined in each script that is registered when setting the Cmdline resource. Specify the same KeyName for the paired operational system and standby system and define a KeyName for other systems to avoid duplicate names. This key name is specified as an argument to register a script when setting Cmdline resources explained later.

-

Mode

Specify the architectural pattern for network takeover.

For network takeover by replacing the Elastic IP address, specify the string of ELASTIC or elastic.

-

CFNameX

Specify the CF node name.

-

InstanceID

Specify the instance ID of AWS on which the cluster host is operating.

Check with the AWS Management Console

AllocationID

Allocation ID of the Elastic IP address

Check with the AWS Management Console

ENIID

Specify ENIID of the network interface that is allocated to the Elastic IP address.

Check with the AWS Management Console

ProfileName

Specify the profile name of the credentials used with the AWS Command Line Interface configured in "21.3 Presetting."

When it is omitted, the device operates with the default profile.

-

Example

The profile name of the credentials used with the AWS Command Line Interface is userprofile1.

CmdE01 ELASTIC node1 i-xxxxxxxx eipalloc-xxxxxxxx eni-xxxxxxxx userprofile1
CmdE01 ELASTIC node2 i-yyyyyyyy eipalloc-xxxxxxxx eni-yyyyyyyy userprofile1

For multiple controls such as the mutual standby configuration, separate KeyNames and add the same contents.

CmdE01 ELASTIC node1 i-xxxxxxxx eipalloc-xxxxxxxx eni-xxxxxxxx userprofile1
CmdE01 ELASTIC node2 i-yyyyyyyy eipalloc-xxxxxxxx eni-yyyyyyyy userprofile1
CmdE02 ELASTIC node1 i-xxxxxxxx eipalloc-xxxxxxxx eni-aaaaaaaa userprofile1
CmdE02 ELASTIC node2 i-yyyyyyyy eipalloc-xxxxxxxx eni-bbbbbbbb userprofile1

Note

  • Use one line per node, separated by spaces.

  • For InstanceID and ENIID, enter the ID information of the operational system and the standby system.

  • If the settings are not correct, the Elastic IP cannot be associated correctly, resulting in a resource failure.

Definition file for network takeover by rewriting DNS records

To update DNS records, the ID information of the device managed by AWS and the information to update the DNS records are required.

When taking over the network by rewriting DNS records, create the definition file and the file for updating the DNS records (JSON format).

The definition file and the file for updating DNS records are explained in order.

Check each ID in AWS described in the definition file (/usr/opt/reliant/etc/hvawsconfig) with the AWS Management Console.

Information in the definition file
KeyName Mode CFNameX InstanceID HostZoneID change-batch [ProfileName]

Item

Contents

Remarks

KeyName

Describe the ID up to 16 letters and numbers. KeyName is case-sensitive.

This key name is defined in each script that is registered when setting the Cmdline resource. Specify the same KeyName for the paired operational system and standby system and define a KeyName for other systems to avoid duplicate names. This key name is specified as an argument to register a script when setting Cmdline resources explained later.

-

Mode

Specify the architectural pattern for network takeover.

For network takeover by rewriting the DNS records, specify the string of DNS or dns.

-

CFNameX

Specify the CF node name.

-

InstanceID

Specify the instance ID of AWS on which the cluster host is operating.

Check with the AWS Management Console

HostZoneID

Specify the host zone ID.

Check with the AWS Management Console

change-batch

Record information file to update DNS (specified by the absolute path.)

To create the record information file, refer to "Record information to update DNS."

-

ProfileName

Specify the profile name of the credentials used with the AWS Command Line Interface configured in "21.3 Presetting."

When it is omitted, the device operates with the default profile.

-

Example

The record information file to update DNS is /home/node1.json_sample, and the profile name of the credentials used with the AWS Command Line Interface is userprofile1.

CmdD01 DNS node1 i-xxxxxxxx xxxxxxxx /home/node1.json_sample userprofile1
CmdD01 DNS node2 i-yyyyyyyy xxxxxxxx /home/node2.json_sample userprofile1

For multiple controls such as the mutual standby configuration, separate KeyNames and add the same contents.

CmdD01 DNS node1 i-xxxxxxxx xxxxxxxx /home/node1.json_sample userprofile1
CmdD01 DNS node2 i-yyyyyyyy xxxxxxxx /home/node2.json_sample userprofile1
CmdD02 DNS node1 i-xxxxxxxx xxxxxxxx /home/node1.json_sample2 userprofile1
CmdD02 DNS node2 i-yyyyyyyy xxxxxxxx /home/node2.json_sample2 userprofile1

Note

  • Use one line per node, separated by spaces.

  • For InstanceID, enter the ID information of the operational system and the standby system.

  • If the settings are not correct, the record of DNS information cannot be updated correctly, resulting in a resource failure.

Record information to update DNS

Use the following samples to create the file to update DNS records (JSON format) for the operational system node and the standby system node. Create the file with a root user and change the permission to 600. Create a JSON file in any location with any file name. For details on this file, refer to the documentation of Amazon Route 53 that is the official AWS documentation.

Example

Item

Value

Setting value

Description

Action

UPSERT

Fixed

To update resource records, specify UPSERT.

Name

Domain name

Specified

Describe the taken over domain name to be set for records.

Total length of the domain name can be up to 255 letters. (AWS policy)

Type

A

Fixed

Specify A to associate the IPv4 address.

TTL

Time (second)

Specified

Specify the survival time (seconds) to cache the information of records.

The initial value of TTL (Time to Leave) is 300 seconds.

Value

IP address of the operational/standby system

Specified

In Online processing in the operational system and the standby system, specify the private IP address to associate with the domain in each file.

Note that only this value is different for operational and standby systems.

Description example of the operational system: /home/node1.json_sample

{
 "Comment": "CREATE/DELETE/UPSERT a record ",
 "Changes": [{
 "Action": "UPSERT",
     "ResourceRecordSet": {
         "Name": "sub.fujitsu.com",
         "Type": "A",
         "TTL": 300,
         "ResourceRecords": [{ "Value": "172.30.10.10" }]
}}]
}

Description example of the standby system: /home/node2.json_sample

{
 "Comment": "CREATE/DELETE/UPSERT a record ",
 "Changes": [{
 "Action": "UPSERT",
     "ResourceRecordSet": {
         "Name": "sub.fujitsu.com",
         "Type": "A",
         "TTL": 300,
         "ResourceRecords": [{ "Value": "172.30.20.20" }]
}}]
}

21.10.1.2 Checking the Network Takeover Settings

Execute the following command on all nodes and make sure that the information described in the definition file (/usr/opt/reliant/etc/hvawsconfig) is correctly described to control the device of AWS.

# /opt/SMAW/bin/hvawschkconf

If there are no problems with the contents of the definition file, the display is as follows.

Example) The definition file is /usr/opt/reliant/etc/hvawsconfig.

# /opt/SMAW/bin/hvawschkconf
NOTICE: Check completed successfully. file=/usr/opt/reliant/etc/hvawsconfig

If there is a problem with the contents of the definition file, the setting value that must be checked is output. Follow the displayed message to take an action.

For details on the hvawschkconf (8) command messages, refer to "PRIMECLUSTER Messages."

21.10.1.3 Building Cluster Application

This section describes how to register the network takeover to the cluster application.

Architectural pattern

Registered resource

Usage

Network takeover by the virtual router

Cmdline resources

Takeover network resources

In the operational system, the routes of the virtual router are updated.

In the operational system, the takeover IP address is activated.

Network takeover by rewriting DNS records

Cmdline resources

In the operational system, the DNS record information is updated.

Network takeover by replacing the Elastic IP address

Cmdline resources

In the operational system, the Elastic IP address is associated with the network interface (ENIID).

21.10.1.3.1 Setting Cmdline Resources for Network Takeover

The procedure to register Cmdline resources is the same for all architectural patterns for network takeover.

For details on how to set Cmdline resources, refer to the procedure for setting up Cmdline resources described in "6.7.3 Setting Up Resources" in "PRIMECLUSTER Installation and Administration Guide", and set the setting values described in "Table 21.1 Creating Cmdline resources and setting Online/Offline/Check scripts."

Table 21.1 Creating Cmdline resources and setting Online/Offline/Check scripts

Parameter name

Setting value

StartCommands[0]

Set the following value.

/opt/SMAW/bin/hvawsipalias -c KeyName

KeyName

Specify the KeyName that was predefined in the definition file (/usr/opt/reliant/etc/hvawsconfig).

StopCommands[0]

Set the following.

/opt/SMAW/bin/hvawsipalias -u KeyName

KeyName

Specify the argument equal to KeyName specified in StartCommands.

CheckCommands[0]

Set the following.

/opt/SMAW/bin/hvawsipalias -m KeyName

KeyName

Specify the argument equal to KeyName specified in StartCommands.

CheckCommandTimeouts[0]

Specify the amount of time it takes until PRIMECLUSTER diagnoses an error when the command specified in CheckCommands[X] has hung up.

Set the value of SCRIPTTIMEOUT (default value is 300 seconds).

Flags[0]

Settings of the AUTORECOVER attribute (Initial value is valid) and the TIMEOUT attribute are optional.

All other attributes should be the default settings.

Setting example:

Flags[0]=XAT300 (AutoRecover valid)

Flags[0]=XT300 (AutoRecover invalid)

Note

The AWS Command Line Interface is used in monitoring processing of Cmdline resources for network takeover.

If the path to the API endpoint is blocked by an error of the NAT instance or the NAT gateway, the AWS Command Line Interface ends with an error and the monitoring processing for network takeover fails. In this case, the cluster application is switched. If you wish to prevent the cluster application from switching because the path to the API endpoint is blocked, set the parameters in "Table 21.1 Creating Cmdline resources and setting Online/Offline/Check scripts" as follows and disable the monitoring of network takeover.

Parameter name

Setting value

StartCommands[0]

Set the same value as the value in "Table 21.1 Creating Cmdline resources and setting Online/Offline/Check scripts."

StopCommands[0]

Set the same value as the value in "Table 21.1 Creating Cmdline resources and setting Online/Offline/Check scripts."

CheckCommands[0]

Set "none".

CheckCommandTimeouts[0]

Set "none".

Flags[0]

Setting of the TIMEOUT attribute is optional.

Setting example:

Flags[0]=DT300

21.10.1.3.2 Setting Takeover Network Resources Used for the Network Takeover by the Virtual Router

To set up the takeover network resources, refer to "6.7.3.6 Setting Up Takeover Network Resources" in "PRIMECLUSTER Installation and Administration Guide."

The cluster configuration file /usr/opt/reliant/etc/hvipalias for presetting this configuration must be described by the following rules:

CFNameX takeover interface netmask
CFNameX     : CF node name of the node which uses the takeover IP address
takeover : Host name of the takeover IP address
interface : Network interface name on which the takeover IP address will be activated
netmask : Netmask for the takeover IP address(0xffffffff)

Note

The following steps are required to set up the takeover network resources when using network takeover by the virtual router.

  • The IP address taken over by the network takeover by the virtual router must be the network different from the CIDR range of the VPC.

  • For the netmask described in the cluster configuration file, specify 32-bit (specify 8 digits in hexadecimal) 0xffffffff.

  • Set VIRTUAL (default value) for the BASE attribute and the VIRTUAL attribute of the takeover network resources.

Example

The CIDR range of VPC is 172.30.0.0/17.

  • /etc/hosts

    172.31.0.10 takeoverip # takeoverIP
  • /usr/opt/reliant/etc/hvipalias

    node1 takeoverip eth1 0xffffffff
    node2 takeoverip eth1 0xffffffff