Create LVM Physical Volume, Volume Group and Logical Volume (Both Nodes)
The commands below assume that /dev/sdb will be used for the DRBD partitionon top of LVM configuration, and that the disks are EXACTLY the same size.
Code Block |
---|
# Create the phsyical volume - this is based on sdb assuming it is the second drive on the system
lvm pvcreate /dev/sdb
# Create the volume group
lvm vgcreate "vg_drbd_jtelshared" /dev/sdb
# Create the logical volume
lvm lvcreate -l +100%FREE vg_drbd_jtelshared -n lv_drbd_jtelshared |
...
Code Block |
---|
# Prepare the firewall
firewall-cmd --zone=public --add-port=7788-7799/tcp --permanent
firewall-cmd --reload |
Install elrepo to yum (Both Nodes)
Code Block |
---|
# Install elrepo
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm |
...
Code Block |
---|
drbdadm disk-options --c-plan-ahead=0 --resync-rate=110M jtelshared |
Create filesystem (
...
First Node)
Code Block |
---|
mkfs.xfs -L data /dev/drbd0 |
Create fstab entry for file system (
...
Both Nodes)
Add the following line to /etc/fstab
Code Block |
---|
/dev/drbd/by-res/jtelshared/0 /srv/jtel/shared xfs noauto,noatime,nodiratime 0 0 |
Mount the file system (
...
First Node)
Add the following line to /etc/fstab
Code Block |
---|
mkdir /srv/jtel
mkdir /srv/jtel/shared
chown -R jtel:jtel /srv/jtel
mount /srv/jtel/shared |
Wait for initial sync to complete (Either Node)
Code Block |
---|
cat /proc/drbd
-->
# When not yet done:
version: 8.4.10-1 (api:1/proto:86-101)
GIT-hash: a4d5de01fffd7e4cde48a080e2c686f9e8cebf4c build by mockbuild@, 2017-09-15 14:23:22
1: cs:SyncTarget ro:Secondary/Primary ds:Inconsistent/UpToDate C r-----
ns:0 nr:3955712 dw:3950592 dr:0 al:8 bm:0 lo:5 pe:0 ua:5 ap:0 ep:1 wo:f oos:264474588
[>....................] sync'ed: 1.5% (258272/262132)M
finish: 2:08:08 speed: 34,388 (25,652) want: 112,640 K/sec
-->
# When done:
version: 8.4.10-1 (api:1/proto:86-101)
GIT-hash: a4d5de01fffd7e4cde48a080e2c686f9e8cebf4c build by mockbuild@, 2017-09-15 14:23:22
1: cs:Connected ro:Secondary/Primary ds:UpToDate/UpToDate C r-----
ns:0 nr:15626582 dw:284051762 dr:0 al:8 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0 |
...
Code Block |
---|
drbdadm adjust jtelshared |
...
Mount the file system and make the second node primary
...
(Second Node)
Add the following line to /etc/fstab
Code Block |
---|
mkdir /srv/jtel
mkdir /srv/jtel/shared
chown -R jtel:jtel /srv/jtel
drbdadm primary jtelshared |
...
Code Block |
---|
|
mount /srv/jtel/shared
service nmb start
service smb start
# Now check access to the SMB share via (for example) one of the windows machines.
service smb stop
service nmb stop
umount /srv/jtel/shared
# do same again on other node |
Unmount and disable SAMBA (Both Nodes)
...
Code Block |
---|
|
service smb stop
service nmb stop
umount /srv/jtel/shared
systemctl disable smb |
...
Code Block |
---|
|
# Failover to node 2
pcs cluster standby uk-acd-store1
# ... (wait)
pcs status
# Then test the availability of the files from the windows machines.
# Create a new file before failing back (to make sure DRBD working ok).
# Fail back to node 1
pcs cluster unstandby uk-acd-store1
pcs cluster standby uk-acd-store2
# ... (wait)
pcs status
# Then test the availability of the files from the windows machines.
# Check that the new file created above is available.
# Unstandby node 2
pcs cluster unstandby uk-acd-store2 |
Manually link /home/jtel/shared (Both Nodes)
Code Block |
---|
title | link /home/jtel/shared |
---|
|
ln -s /srv/jtel/shared /home/jtel/shared |