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
[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.
Asynchronization 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 Synchronization 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.
Synchronization 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.
- When add a resource from a group name, select a group → right click → "Add Resource". Or select "Edit(E)" from the main menu bar → select "Add Resource". Or select "Add Resource" icon from the tool bar.
Select "MirrorDisk" from Resource Type lists and click the "Next" button. When add a resource from the MirrorDisk resource type name, this step will be skipped.
- Enter the resource name.
- Select the source server and mirror volume, and enter the mount point.
The virtual device, mirror ip and mirror port will be set automatically.
If mirror disk is already configured on the volume, "mirrored" will be followed next to the volume name. This case you cannot edit the its attributes.
[Figure] Mirror Disk Added- As the "Additional Settings", Mirror Type option is available and click the "OK" button. Default is "Semi-Synchronization" Mode.
[Figure] Mirror Disk Additional Setting - When click the "OK" button, following warning message will be displayed and click the "OK" button if the informations are correct.
[Figure] Alert popup message after click OK button - Click the "Finish" button to add the mirror disk resource
Deleting
Select resource type → right click → delete resource.
(Current online mirror disk resource cannot be deleted. So it should be taken offline before delete it.)
- Click the "Delete resource" button and a confirming message about deleting resource will appear.
[Figure] Check resource view - Click the "OK" button and a confirming message about deleting the mirror configuration will appear.
[Figure] Deleting mirror disk view - Click the "OK" button and mirror disk is deleted.
State
The following table explains the state of mirror disk resource.
Mirror disk agent: Manages a mirror disk, and to use this, it is necessary to install a replication program.
State | Agent command | Description | Note |
---|---|---|---|
Online Source disk is accessible to read/write. | Offline | It unmounts (umount) the mirror disk from the mount point and the role of mirror disk is demoted to Secondary. | |
Monitoring | MCCS consistently handles events of the replication service. | ||
Offline Source and target disk is not fault state but locked so that cannot access both disk. | Online | Type of operation is determined by the role of the mirror disk at the node. <Target role disk> 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 Fail on writing test in online state or fail on attempts to bring online. *Failover disabled state | Online | Refer to the above online command. | |
Offline | It unmounts (umount) the mirror disk from the mount point and the role of mirror disk is demoted to Secondary. |
Attribute
Show the specified attribute of mirror disk resource.
Attribute | Description | Type | Default | Edit | Note |
ChkDskTimeout | It is timeout limit to complete or stop the check disk of mirror disk before attaching the disk . If value is '0', MCCS waits to complete the check disk before attaching the disk. | INTEGER | 0 | O | |
ConnectState | Display the status of connection between the mirror disk's nodes. | STRING | X | ||
DiskState | Display the status of disk managed by the mirror disk. | STRING | X | ||
DoFsck | If this is set to true, it perform the check disk command when the mirror disk is taken online. | BOOLEAN | false | O | |
DRBDVolumeName | Displays the name managed by DRBD | STRING | X | ||
FsckOpt | Defines fsck options. | STRING | -y | O | |
GI | It is an identifier used to determine whether each household's data copied by the mirror disk is of the latest version. | STRING | X | ||
GIState | It is the status value that compares each node's GI (Generation Identifier) values. | STRING | X | ||
KillBusyApps | When the mirror resource goes offline, determine whether to forcefully terminate the tasks that refer to the mirror resource. | BOOLEAN | true | O | |
LastMirrorOnlineTime | Record the system time where the mirror disk went online most recently. | STRING | X | ||
MetaDisk | It is the disk where meta data is saved. | STRING | X | ||
MirrorIP | It is an IP address used by mirror disk. | STRING | X | ||
MirrorNetConnectStatus | Display the connection status of the physical mirror network. True: Mirror network connection. (Disconnection by a user's command does not affect the attribute.) | BOOLEAN | true | X | |
MirrorPort | It is the communication port number used for mirror disk. | STRING | 7789 | X | |
MirrorVolume | It is the name of block device actually used by mirror disk. | STRING | X | ||
MountPoint | It is the absolute path for the mounting point. | 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 replicated or synchronized. | STRING | 0 | X | |
ProtocolType | It displays mirror type. A = Async mode B = Semi sync mode C = Sync mode | STRING | B | X | |
ReayncRate | The ratio of resynchronization between the disk. | INTEGER | X | ||
RoleState | Display the disk role (Primary or Secondary) of the node. | STRING | X | ||
SB0Policy | If every member within a cluster is secondary, this split-brain recovery policy is automatically executed. | STRING | X | ||
SB1Policy | If a member within a cluster is primary, this split-brain recovery policy is automatically executed. | STRING | X | ||
SB2Policy | If every member within a cluster is secondary, this split-brain recovery policy is automatically executed. | STRING | X | ||
Synced | It represents the progress of volume synchronization. | INTEGER | 0 | X | |
TotalSpace | It represents the total size of the target mirror disk. | INTEGER | 0 | X | |
UsedSpace | It represents the available size of the target mirror disk. | INTEGER | 0 | X | |
VirtualDevice | This is a virtual device name used by mirror disk. | STRING | X |
Specified attribute values are normally entered when add the resource, This value can be edited or viewed through 'Specified Attribute' table in the Resource Attributes tab on the detailed information panel.
MCCS has function to limit input values against user's input field, and it provides function detects automatically data which is input wrong by user's mistake.