Installation guide

Chapter 5. LVM Configuration Examples
66
5.5. Creating a Mirrored LVM Logical Volume in a Cluster
Creating a mirrored LVM logical volume in a cluster requires the same commands and procedures
as creating a mirrored LVM logical volume on a single node. However, in order to create a mirrored
LVM volume in a cluster the cluster and cluster mirror infrastructure must be running, the cluster must
be quorate, and the locking type in the lvm.conf file must be set correctly to enable cluster locking,
either directly or by means of the lvmconf command as described in Section 3.1, “Creating LVM
Volumes in a Cluster”.
The following procedure creates a mirrored LVM volume in a cluster. First the procedure checks to
see whether the cluster services are installed and running, then the procedure creates the mirrored
volume.
1. In order to create a mirrored logical volume that is shared by all of the nodes in a cluster, the
locking type must be set correctly in the lvm.conf file in every node of the cluster. By default, the
locking type is set to local. To change this, execute the following command in each node of the
cluster to enable clustered locking:
# /sbin/lvmconf --enable-cluster
2. To create a clustered logical volume, the cluster infrastructure must be up and running on every
node in the cluster. The following example verifies that the clvmd daemon is running on the node
from which it was issued:
[root@doc-07 ~]# ps auxw | grep clvmd
root 17642 0.0 0.1 32164 1072 ? Ssl Apr06 0:00 clvmd -T20 -t 90
The following command shows the local view of the cluster status:
[root@example-01 ~]# cman_tool services
fence domain
member count 3
victim count 0
victim now 0
master nodeid 2
wait state none
members 1 2 3
dlm lockspaces
name clvmd
id 0x4104eefa
flags 0x00000000
change member 3 joined 1 remove 0 failed 0 seq 1,1
members 1 2 3
3. Ensure that the cmirror package is installed.
4. Start the cmirrord service.
[root@hexample-01 ~]# service cmirrord start
Starting cmirrord: [ OK ]