1. Have a root access on each servers
2. Using GPARTED create partition on both servers with a capacity of at least 2.0GB. Remember to take note of the name of the partitions since were gonna use them both in the configuration.
Creating partition using GPARTED |
3. After creating partitions you can now configure the drbd.conf file. This is located in /etc/drbd.conf. You can use Vi, Gedit or anything that is comfortable to you.
NOTE : Before configuration you need to do these steps first.
3.1 Rename each servers accordingly by doing this commands on the terminal.
a. hostname [your_hostname] (eg. hostname drbd01).
b. edit /etc/hostname then change the value with the respective hostname you used.
3.2 Acquire each of the computer's IP address by typing IFCONFIG.
After doing this two steps we can now configure drbd.conf. Just input the values similar to the image below on both computers or on the server1 alone then using scp just copy it to the second server (tests connectivity too!).
DRBD Configuration |
As you can notice we will use the hostname, partition name and the ip address of both servers in the configuration so make you sure you have taken note of this properly.
4. After configuring drbd.conf we can now start the drbd by typing /etc/drbd.init start (you can also replace start with restart if the service is already running for the configuration to take effect). The following responses should appear as shown in the image below. Do this on both servers.
Initializing DRBD |
Monitoring server1 |
a. sudo mkfs.ext3 /dev/drbd0
b. sudo mount /dev/drbd0 /srv