2017-07-14 62 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

祝您好運