DRBD - 'node1' not defined in your config (for this host) - Error when setting Primary
0
votes
1
answer
11526
views
I am getting the following error when trying to set the Primary node for DRBD.
'node1' not defined in your config (for this host).
I know this is related to DNS/Hostname/Hosts and the config clusterdb.res. I know this because I originally got an error when trying to start clusterdb.res if node1 didn't resolve correctly. So what confuses me is that I can start the clusterdb.res if either use:
*I have used this command on the hosts*
hostnamectl set-hostname $(uname -n | sed s/\\..*//)
To make the hostname resolve to node1 instead of node1.localdomain
Or add node1.localdomain to the config, either works. But I have tried all combinations and can't seem to get this command to take :
drbdadm primary --force node1 && cat /proc/drbd
**My Configs**
/etc/drbd.d/clusterdb.res
resource clusterdb{
protocol C;
meta-disk internal;
device /dev/drbd0;
startup {
wfc-timeout 30;
outdated-wfc-timeout 20;
degr-wfc-timeout 30;
}
net {
cram-hmac-alg sha1;
shared-secret sync_disk;
}
syncer {
rate 10M;
al-extents 257;
on-no-data-accessible io-error;
verify-alg sha1;
}
on node1 {
disk /dev/sda3;
address 192.168.1.216:7788;
}
on node2 {
disk /dev/sda3;
address 192.168.1.217:7788;
}
}
/etc/hosts :
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.216 node1
192.168.1.217 node2
/etc/hostname
node#
My full write up ATM (wip)
**Edits :**
[root@node1 ~]# hostname
node1
[root@node1 ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
127.0.1.1 node1
192.168.1.216 node1
192.168.1.217 node2
[root@node1 ~]#
Update: I have gotten this to work with LVM following this guide exactly, so I think my issue actually lies with the following lines of code. But for now I think i will stick with LVM since it works, unless somebody else really wants to work on this. (My working LVM writeup)
device /dev/drbd0;
or
device /dev/drbd0;
The reason I say this, is I used the same hosts/hostname/shortname/ip_addr but LVM and it worked, but maybe I missed something the first time, I fixed in my new VM Template (I started from scratch to build LVM)
Asked by FreeSoftwareServers
(2682 rep)
May 1, 2016, 01:59 AM
Last activity: Mar 8, 2023, 02:50 AM
Last activity: Mar 8, 2023, 02:50 AM