Configure drbd on proxmox

Hello everyone,

i am new here in linstor :slight_smile: . i have 2 Proxmox Nodes and q-device “Lenove old PC”.

I configured the proxmox over this guide: How to Setup LINSTOR on Proxmox VE - LINBIT

There is a link at the end of this guide about how to make the linstor controller highly available so i configured also.

My 2 nodes are old servers and they are for testing. We will buy new servers when i figure out what for components on the servers we need.

pve01 172.16.222.1/24
pve02 172.16.222.2/24

The servers have a different type of Hard drives "pve01 -> SSDs, pve02 ->HDDs".
I know that the Performance is variable but for test it is ok. So i have 2 quotations:

Let’s say that my DRBD Storage is configured on node01

root@pve02:~# cat /etc/pve/storage.cfg 
dir: local
	path /var/lib/vz
	content iso,vztmpl,backup

lvmthin: local-lvm
	thinpool data
	vgname pve
	content rootdir,images

drbd: linstor_storage
	content images,rootdir
	controller 172.16.222.1
	resourcegroup pve-rg

1- when the pve01 goes down. the drbd storage is not anymore reachable. Should i configure keepalived on 2 servers with virtual ip? Or is there better way that i can learn it? :slight_smile:


I tested the Power failure on node01. Let’s say we have the following scenario:

a client tried to write a data on the drbd storage. then Power failure happened. How many Data we lost? To answer on this quotation i wrote the following script on a test-vm.

#!/bin/bash

duartion=300

for((i0; i<$duartion; i++)) do
  current_time=$(date +"%Y-%m-%d %H:%M:%S")
  echo $current_time >> foo.txt
  echo $current_time
  sleep 1
done

with this script i can print the output of the current_time in seconds and write it in foo.txt

root@debian-test:~# ./foo.sh 
2024-09-07 10:40:52
2024-09-07 10:40:53
2024-09-07 10:40:54
2024-09-07 10:40:55
2024-09-07 10:40:56
^C
root@debian-test:~# cat foo.txt 
2024-09-07 10:40:52
2024-09-07 10:40:53
2024-09-07 10:40:54
2024-09-07 10:40:55
2024-09-07 10:40:56
root@debian-test:~#

so i started the script on the debian-test which is on HA on proxmox. I pulled the power-cabel when the debian-test wrote the following lines

root@debian-test:~# ./foo.sh 
2024-09-07 10:44:46
2024-09-07 10:44:47
2024-09-07 10:44:48
2024-09-07 10:44:49
2024-09-07 10:44:51
2024-09-07 10:44:52
2024-09-07 10:44:53
2024-09-07 10:44:54
2024-09-07 10:44:55
2024-09-07 10:44:56

I waited 2 Minutes then the debian-test was online on pve02 then i checked the foo.txt file

root@debian-test:~# cat foo.txt 
2024-09-07 10:44:46
2024-09-07 10:44:47
2024-09-07 10:44:48
2024-09-07 10:44:49
2024-09-07 10:44:51
2024-09-07 10:44:52

As you see 4 Seconds have been lost. Did i miss something? Is it because of HDDs on pve02?

What can i do to save the data?

Sorry for taking your time :slight_smile:

Best regards
Yousef

If you followed the LINSTOR user’s guide section that uses DRBD Reactor to make the LINSTOR controller highly available, you need at least three nodes in your cluster. This is because DRBD Reactor uses DRBD’s quorum status to promote resources.

Keepalived or Pacemaker could be used instead when you only have two nodes.

You shouldn’t lose any data. Perhaps the writes are stuck in buffers somewhere. Try adding a sync to your script to test this:

#!/bin/bash

duartion=300

for((i0; i<$duartion; i++)) do
  current_time=$(date +"%Y-%m-%d %H:%M:%S")
  echo $current_time >> foo.txt; sync
  echo $current_time
  sleep 1
done

thank you Kermat.

i already installed the drbd-reactor and i configured it. My mistake was that i should put the 2 linstor controller

drbd: linstor_storage
	content images,rootdir
	controller 172.16.222.1,172.16.222.2
	resourcegroup pve-rg

the replication problem has been solved. One of old servers was problematic. the server could not handle with the data like the other server. so i replaced the server with lenove pc. Now i see the PVE servers replicate in real time :slight_smile:

1 Like