2017-07-14 97 views
-2

按照本指南在CentOS 7.3安装DRBD:为什么不能在CentOS 7上创建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"; 

什么问题的原因是什么?

+0

难道这些配置文件都主机? –

+0

@RamanSailopal你是指'/ etc/hosts'中的内容吗?是。 –

+0

不,我的意思是drbd文件? –

回答

0

来解决这个问题 注:配置文件存在同样的两个主机上/etc/drbd.d/*.res

  1. 下,首先,请允许端口通信7788

  2. 然后检查节点的主机名并验证#vi /etc/sysconfig/network包含相同的主机名

  3. 最后但并非最不重要

    # vi /etc/hosts

    <IP1> node1.abc.com node1

    <IP2> node2.abc.com node2

    ...保存它,然后

  4. #drbdadm create-md testdata1

祝您好运