遵循此指南在CentOS 7.3上安装DRBD:

http://www.learnitguide.net/2016/07/how-to-install-and-configure-drbd-on-linux.html

完成此步骤后:

resource testdata1 {
protocol C;
on node1 {
        device /dev/drbd0;
        disk /dev/sdb;
        address 172.16.2.61:7788;
        meta-disk internal;
    }
    on node2 {
        device /dev/drbd0;
        disk /dev/sdb;
        address 172.16.2.62:7788;
        meta-disk internal;
    }
}


运行时:

drbdadm create-md testdata1


得到消息:

'testdata1' not defined in your config (for this host).


/etc/hosts是:

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

172.16.2.61              node1.clusterbr.int   node1
172.16.2.62              node2.clusterbr.int   node2
172.16.2.60              dbip.clusterbr.int   node1


/etc/drbd.conf配置为:

# You can find an example in  /usr/share/doc/drbd.../drbd.conf.example

include "drbd.d/global_common.conf";
include "drbd.d/*.res";


是什么原因引起的?

最佳答案

原因是没有在drbd配置文件上设置正确的主机名。

使用uname -a可以看到主机名。将其设置为配置。

由于此:

https://newbiedba.wordpress.com/2015/09/21/drbd-not-defined-in-your-config-for-this-host/

关于linux - 为什么不能在CentOS 7上为DRBD创建资源?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/45101036/

10-11 23:20