help for /etc/hosts file in a HA cluster with DRBD9

Kei

Active Member
May 29, 2016
88
2
28
37
Hello,
I am a little confused when it comes to implement a separate network for DRBD9, because I'm supposed to have a resolution in my hosts file for both corosync (PVE cluster) and also for DRBD. So I'm not sure how am I supposed to setup my hosts file. Anyone with an HA cluster + DRBD9 can share their file? Thank you!
 
You have to put two lines in the hosts files for every hostname; one beginning with the ip for the storage network, one with the ip of the ordinary network.
That's it.

bye,
rob
 
Sorry the dumb question, but how is the system supposed to know when it should resolve the hostname as IP of management or IP of the DRBD network?
 
Maybe I wrongly assume that you need to have the same hostname for both MGMT and DRBD addresses?
 
Sorry the dumb question, but how is the system supposed to know when it should resolve the hostname as IP of management or IP of the DRBD network?

Not a dumb question at all. You do not need hostname -> ip resolution for configuring drbd9, you provide IP of the nodes (
drbdmanage add-node -q <node-name> <ip>) . Personally i put storage network IPs in /etc/hosts only to enable reverse lookup for ssh.
 
Sorry if I bother again. I was confused by the fact that, when you are almost done typing "drbdmanage add-node <node name>" and you are about to type the first characters of the IP address, you find out that you can press TAB and it will autocomplete, using the hosts file resolution. But accordingly to what I understand from you, I could write anything instead of "hostname" and it would work anyways. Is this correct?
 
From "man drbdmanage-add-node":
Nodename must match the name that is used as the node name of
the drbdmanage server on the new participating node. Commonly, nodename
is set to match the output of "uname -n" on the new participating node.
rob
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!