Mounting the DRBD resource and using it with Apache
Before using the DRBD resource, you must define a filesystem on it and mount it on a local directory. We will use Apache's document root directory (/var/www/html
), but given the case, you could use a virtual host directory as well. As we did earlier, we will add these changes in a configuration file, step by step, and we will push it to the running CIB later on node01
(or whatever the DC is).
To begin, create a new configuration file named fs_dbrd0_cfg
(feel free to change the name if you want):
pcs cluster cib fs_drbd0_cfg
Next, we'll create the filesystem resource itself (again, change the variable values if needed). This is another special type of resource provided out of the box:
pcs -f fs_drbd0_cfg resource create web_fs Filesystem device="/dev/drbd0" directory="/var/www/html" fstype="ext4"
It indicates that the filesystem should always be available on the master DRBD resource:
pcs -f fs_drbd0_cfg constraint colocation add web_fs with...