We no longer support DRBD on the base file system. We always install with LVM for maintenance purposes.
We use the whole disk, so increasing size is done using LVM by adding new disks.
It is recommended to create the STORE machine without the disk for the storage being mounted by the installation routines.
The commands below assume that /dev/sdb will be used for the DRBD on top of LVM configuration, and that the disks are EXACTLY the same size.
# 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 |
# Prepare the firewall firewall-cmd --zone=public --add-port=7788-7799/tcp --permanent firewall-cmd --reload |
Prepare Mount Point (Both Nodes)
The data should be mounted to the directory /srv/jtel/shared.
The following commands prepare for this:
mkdir /srv/jtel mkdir /srv/jtel/shared chown -R jtel:jtel /srv/jtel |
We now install DRBD 9. This requires using the ELrepo.
dnf -y install https://www.elrepo.org/elrepo-release-8.el8.elrepo.noarch.rpm rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org dnf -y install drbd90-utils kmod-drbd90 systemctl enable drbd systemctl start drbd |
DRBD must be configured with static ip addresses and correct hostnames.
The IP addresses below must be modified:
# Configure DRBD cat <<EOFF > /etc/drbd.d/jtelshared.res resource jtelshared { protocol C; meta-disk internal; device /dev/drbd0; syncer { verify-alg sha1; } net { allow-two-primaries; } on acd-store1.jtel.local { disk /dev/vg_drbd_jtelshared/lv_drbd_jtelshared; address 10.1.1.1:7789; } on acd-store2.jtel.local { disk /dev/vg_drbd_jtelshared/lv_drbd_jtelshared; address 10.1.1.2:7789; } startup { become-primary-on both; } } EOFF |
# Create metadata and start DRBD drbdadm create-md jtelshared drbdadm up jtelshared |
# Make ONE node primary drbdadm primary jtelshared --force |
DRBD will now sync. This might take some time, however, you do not have to wait, as long as you make sure the primary is active in the PCS cluster below.
Note: with DRBD9 we currently have no options to tune the transfer.
You can watch the initial sync with the following command:
drbdadm status jtelshared |
You will see outbout like this:
jtelshared role:Primary disk:UpToDate acd-store2 role:Secondary replication:SyncSource peer-disk:Inconsistent done:7.19 |
This means the following:
You can continue, but usually it is best to wait for it to complete.
drbdadm primary jtelshared |
mkfs.xfs -L data /dev/drbd/by-res/jtelshared/0 |
This command adds a line to /etc/fstab
cat << EOFF >> /etc/fstab /dev/drbd/by-res/jtelshared/0 /srv/jtel/shared xfs noauto,noatime,nodiratime 0 0 EOFF |
Now, we can test the DRBD setup.
mount /srv/jtel/shared |
cat <<EOFF > /srv/jtel/shared/test.txt test 123 EOFF umount /srv/jtel/shared |
mount /srv/jtel/shared cat /srv/jtel/shared/test.txt # Check contents of file before proceeding rm /srv/jtel/shared/test.txt umount /srv/jtel/shared |
Do not proceed unless you can see the contents of the test file. |
Pacemaker Corosync Cluster Installation
If you have not installed Pacemaker / Corosync on both LB machines, do this now - see here: Redundancy - Installing PCS Cluster |
These commands install the samba server and client and lsof.
|
The following creates a samba configuration file with a minimum configuration.
|
The following command sets up selinux for the smb service and opens the necessary ports in the firewall:
|
Link the /home/jtel/shared folder.
|
The following command creates the smb credentials for the jtel user.
|
If necessary, add further users to samba - replacing password with the actual password for the user. Here, for example, the windows administrator user:
|