/
7-6 Mirror Disk

7-6 Mirror Disk

In case of MCCS needed data cannot be shared among nodes in a cluster, namely NAS or DAS, may not use latest data after failover. In this case, Mirror disk is used when there is no external shared disk, and is replicated between two nodes by using replication component. MCCS provides replication function of DRBD from Linbit and Mirror Disk Agent manages this replicated data set.
It functions properly according to the state and role of mirror disk. Actions such as state and role of mirror disk are all recorded in the system event log, and this information will be sent to MCCS through event log monitor module.
MCCS event module will start when the MCCS service starts. The DRBD operates by creating mirror set for volumes between two nodes.
The primary server has source volume and the secondary server has target volume which is an exact replica of source volume.
Client is only available to read/write in the source volume, changed block of the volume is replicated to the target volume through the TCP/IP network connection. At this point, target volume is in lock state and read/write is not allowed. This is to ensure data integrity by preventing the use of target volume.

Table of Contents

 

The below figure illustrates that mirroring is set to two servers.

[Figure] Mirroring Configuration



Mirror Mode

Mirror mode employs both asynchronous and synchronous mirroring schemes. Understanding the advantages and disadvantages between synchronous and asynchronous mirroring is essential to the correct operation of this.

Async Mode

With asynchronous mirroring, each write is captured and a copy of this is made. That copy is queued to be transmitted to the target system as soon as the network will allow it. Meanwhile, the original write request is committed to the underlying storage device and control is immediately returned to the application that initiated the write. At any given time, there may be write transactions waiting in the queue to be sent to the target machine.  But it is important to understand that these writes reach the target volume in time order, so the integrity of the data on the target volume is always a valid snapshot of the source volume at some point in time.  Should the source system fail, it is possible that the target system did not receive all of the writes that were queued up, but the data that has made it to the target volume is valid and usable.

 

Semi-sync Mode

 

With semi-synchronous mirroring, each write is captured and transmitted to the target system. Local write completes in the source as soon as the replication packet has reached the target. Normally, no writes are lost in case of failover , but this may can be lost when both nodes are failed simultaneously.

Sync Mode

With synchronous mirroring, each write is captured and transmitted to the target system to be written on the target volume at the same time that the write is committed to the underlying storage device on the source system.  Once both the local and target writes are complete, the write request is acknowledged as complete and control is returned to the application that initiated the write.  With synchronous mirroring, each write is intercepted and transmitted to the target system to be written on the target volume at the same time that the write is committed to the underlying storage device on the source system.  Once both the local and target writes are complete, the write request is acknowledged as complete and control is returned to the application that initiated the write.  

Adding

Add the mirror disk resource to a group.

MCCS for linux support DRBD which is open source for Mirror disk. Therefore, DRBD 8.3.13 must be installed beforehand. 
The size of disk file system that is created by mirror disk should be created with 128MB
128M space is required to store meta data that manages replication volume service. Size of meta data can be changed according to the size of the meta data.
Please refer to DRBD meta data size. (Calculation for more details.) 
When use both DBRB and LVM, only DRBD ON LVM is supported and LVM In DRBD is not supported. 

  1. Select a group → right click → 'Add Resource'.

  2. Select 'MirrorDisk' from Resource Type lists and click 'Next' button.

     

  3. Enter the mirror volume to be used as a mirror disk, mounting position and source server.
    The virtual volume, mirror network address and mirror ports will be entered automatically.

    If DRBD mirror volume is already configured in the volume, "mirrored" will be displayed.
    Also, the config data will be entered automatically during the selection, and you cannot change it. 


    [Figure] Mirror Disk Added


  4. As 'Additional Settings', Mirror Type option is available. Default is Asynchronous Mode.

    [Figure] Mirror Disk Additional Setting

  5. When click OK button, following warning message will be displayed and lick OK button if the informations are correct.
    If you select wrong sever, click cancel button.



  6. Click the 'Finish' button to add the mirror disk.
    You can immediately check the result in the management web console. 

Deleting

Select resource type → right click → delete resource.
(Current online resources and replication programs are configured on the mirror disk mirrored volume can not be deleted)

  1. Click "Delete resource" and a confirming message about deleting resource will appear. 

    [Figure] Check resource view

  2. Click "OK" and a confirming message about deleting the mirror disk. 

    [Figure] Deleting mirror disk view

  3. Click "OK" and mirror disk is deleted. The deleted resource will immediately disappear from the management web console.

 

Status

The following table explains the status switching of the MCCS resource caused by a user's command and the status.
The command assumes that it is generated by a user.

Mirror disk agent: Manages the mirror disk. Copying program should be installed.

StatusAgent commandDescriptionNote

Online

In this status, you can access the source volume and perform a writing test properly.

Offline

If the role of mirror resource is online, Unmount (umount) the mirror disk from the mount point and the role of mirror disk is demoted to secondary.
If the mirror disk is not defined, the command is ignored and regarded as a failure.

 
Monitoring

MCCS consistently handles events of the replication service.
The MCCS event monitor is registered as an event receiver when starting the MCCS service. When a system event occurs, it will be automatically informed and it will detect the mirror disk status and role changes. 
If the mirror disk's role is primary and it is mounted in the designated mount point, it is deemed to be online. 
In other cases, it is recognized as an offline state.
In addition, when you register a new mirror disk, if it is in the primary condition where mounting is not yet to be done, the mirror disk's role is demoted to secondary.

 

Offline

Except for the online and trouble states, it is always offline.

Online

Type of operation is determined by the role of the mirror disk at the node.
 
<Source volume>
After setting the role of mirror disk to Primary, mount it in the designated mount point.

<Target volume>
If you want to go online at the node where the mirror role is target, the following conditions should be met.
1. Both nodes' mirror network conditions are connected.
2. Both nodes' disk states are UpToDate.
3. Peer node's mirror disk role is secondary.

If the mirror disk is not defined, it is processed as a failure without any operation.

 
Monitoring

Refer to the description of monitoring as above.

 

Fault

If a writing test failed online, or an attempt to go online is failed, the trouble state is displayed.

*Failover deactivation state
When a mirror network communication failure, target node or target disk failure occurs, the mirror state is changed from 'MIRRORING' to other, such as 'MIRROR_PAUSED'.
If the mirror status is not 'MIRRORING', a failover will take place and it can cause data losses or damages.
To prevent this problem, an agent deactivates the failover mode if the mirror status is not "MIRRORING". 
If the failover mode is deactivated, no failover will take place even if manual failover or troubles occur.
If mirror network communication failures are recovered, and communication resumes, it will automatically perform RESYNC. When the mirror status is changed to MIRRORING, the failover mode will be also automatically activated.

Online

Refer to the above online command.

 
Offline

If the role of mirror resource is online, Unmount (umount) the mirror volume from the mount point and the role of mirror disk is demoted to secondary.
If the mirror disk is not defined, the command is ignored and regarded as a failure.

 

*If the mirror disk is not defined,

It is regarded as the offline state.

 

Attribute

Show the unique attribute of resource.

Attribute

Description

TypeDefaultEditNote

ConnectState

Display the status of connection between the mirror disk's nodes.

STRING X 
DiskStateDisplay the status of disk managed by the mirror volume.STRING X 
DoFsck

Indicates whether the file system for the mirror volume managed by the resource is checked before the mirror source goes online in MCCS.
( Default=false )

BOOLEANfalseO 
DRBDVolumeNameDisplays the name granted to help DRBD managing the mirror disk.STRING X 
FilesystemType

Display the file system type frequently used by the mirror disk.
(MCCS only supports ext type file systems. ex: ext2, ext3, ext4)
Used for the -t option of the mounting command.

STRING X 
FsckOpt

If the mirror disk's file system is checked, you can use the option entered in this attribute as a parameter.
(Default= -y)

STRING-yO 
GIIt is an identifier used to determine whether each household's data copied by the mirror disk is of the latest version.STRING X 
GIStatusIt is the status value that compares each node's GI (Generation Identifier) values.STRING X 
KillBusyAppsWhen the mirror resource goes offline, determine whether to forcefully terminate the tasks that refer to the mirror resource.BOOLEANtrueO 
LastMirrorOnlineTime

Record the system time where the mirror disk went online most recently.

System time is used for recording, it is not the absolute value that can determine whether the data is latest.
STRING X 
LastPrimary

Display the role of the last mirror disk before connected to the network.

True: The last role was primary.
False: The last role was secondary.

This value is valid only if a split brain occurs.

BOOLEAN

 X 
MetaDataTypeIt is the disk where meta data is saved.
Internal is used to save the meta data in the same partition as the mirror disk.
External is used to save the meta data in the designated device.
STRING X 
MetaDiskThis is the disk where meta data is saved.STRING X 
MirrorIPIt is an IP address used to copy the volume.STRING X 
MirrorNetConnectStatus

Display the connection status of the physical mirror network.

True: Mirror network connection.
False: Mirror network disconnection.

(Disconnection by a user's command does not affect the attribute.)

BOOLEANtrueX 
MirrorPortIt is the communication port number used for mirror disk.STRING7789X 

RoleState

Display the volume role managed by the mirror disk.

STRING X 

MountPoint

Display the mount point for the mirror disk managed by an agent.

STRING X 
MirrorVolumeIt is the name of block device  actually used by mirror disk.STRING X 
MountPointIt is the directory where the file system can be mounted. If there is no directory or if the directory is already in use, you cannot activate it.DIRECTORY O 
OOS

It is the OutOfSync value requiring synchronization.

If the value is non zero, it means that there is some data between the nodes not yet copied or synchronized.
Thus, if the value is zero, a failover is prohibited. 

STRING0X 
ProtocolTypeThis is a data transmission protocol type.
A = Async mode
B = Semi sync mode
C = Sync mode 
STRINGBX 
ReayncRateThe ratio of resynchronization between the disk.INTEGER X 
RoleStateDisplay the role status of the mirror disk.STRING X 
SB0PolicyIf every member within a cluster is secondary, this split-brain recovery policy is automatically executed.STRING X 
SB1PolicyIf a member within a cluster is primary, this split-brain recovery policy is automatically executed.STRING X 
SB2PolicyIf every member within a cluster is secondary, this split-brain recovery policy is automatically executed.STRING X 

SplitBrainStatus

Display the split brain status.

True: Split brain occurred.
False: No split brain.

The attributes are valid only if the network disconnection status and GIStatus attributes have the following status values indicating that a split brain occurred.

SplitbrainDisconnect
SplitbrainTryAutoRecover

The value is set to false, when the split brain problem is resolved.

BOOLEANfalseX 
SyncedIt represents the progress of volume synchronization.INTEGER0X 
TotalSpaceIt represents the total size of the target mirror disk.INTEGER0X 
UsedSpaxeIt represents the available size of the target mirror disk.INTEGER0X 
VirtualDeviceThis is a virtual device name used by mirror disk.STRING X 

 The attribute value is entered to register the resource, and you can change or check it in the 'Specified Attribute'.

 

 

Related content