Friday, December 17, 2010

DRBD notes: Linux platform to achieve high-availability scenarios

Resource management 1, increase the size of the resource: when it comes to our drbdresource equipment capacity, and our underlying device support online increase capacity (such as using lvm), we can increase the size of the underlying device, and then achieved through drbdadmresizeresource_name on expansion of the resource.

But there's one thing to note is that only a single primary mode you can do so, but first of all nodes are increasing the capacity of the underlying device. And then only on the primary node resize command. In the resize command has been executed, will trigger a current primary node to all other secondary node re-synchronization. If our drbd non-operational on underlying equipment capacity expansion, and then start drbd, you will not need to do the resize command (of course, the premise is that in the configuration file is not on the disk parameters specified size), you will know already drbd increases capacity. The underlying device capacity operation time never modify the original equipment of the above data, especially the drbd meta information, or they may destroy all the data. 2. shrinking resource capacity: capacity shrinkage ratio of volume expansion operation much more dangerous, because this operation is more likely to result in data loss. Shrinking resource capacity before shrinking the drbd device over capacity, which is the size of the file system. If the parent file system does not support a contraction, then the resource is also no way to shrink the capacity. If you are configuring drbd meta information when configured as internal, the contraction of the capacity, not only its own data the amount of space required, but also to the meta information drbd needed space plus. When the file system shrink after, online through the following command to reset the size of the resource: drbdadm — size = *** Gresizeresource_name. In the size of the contraction of the resource, you can shrink the release underlying device space (if supported). If you intend to stop in the State of contraction capacity, you can use the following steps: a, b online shrink file system, deactivate the drbd resource: drbdadmdownresourcec_namec, export metadata of drbd (in all nodes are required): drbdadmdump-mdresource_name >/path_you_want_to_save/file_named, shrinkage in all of the node, change the underlying device e dump out the above meta information items to shrink after la-size-sect (is converted into the number of sector values) f, if you are using internal to configure meta-data information, you need to re-create meta-data: drbdadmcreate-mdresource_nameg before export, and modify the meta information of re-importing the drbd (extracted from the official website of linbit some import code): drbdmeta_cmd = $ (drbdadm-ddump-mdtest-disk) $ {drbdmeta_cmd/dump-md/restore-md}/path_you_want_to_save/file_nameh, startup resource: drbdadmupresource_name

No comments:

Post a Comment