与 OCFS2 DRBD 小学模式的建立

来自Chinese Ikoula Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

zh:与 OCFS2 DRBD 小学模式的建立 he:הקמתה של מצב ראשי DRBD עם OCFS2 ro:Stabilirea DRBD-primar modul cu OCFS2 ru:Создание DRBD-основной режим с OCFS2 pl:Ustanowienie DRBD-podstawowy tryb OCFS2 ja:OCFS2 と DRBD プライマリ ・ モードの確立 ar:إنشاء وضع DRBD-الابتدائية مع OCFS2 de:Einrichtung von DRBD-Primär-Modus mit OCFS2 nl:Oprichting van DRBD-primaire modus met OCFS2 it:Creazione di modalità DRBD-primary con OCFS2 pt:Estabelecimento de modo primário DRBD com OCFS2 es:Establecimiento del modo primario de DRBD con OCFS2 en:Establishment of DRBD-primary mode with OCFS2 fr:Mise en place de DRBD en mode primaire-primaire avec OCFS2

这篇文章是从由软件进行自动翻译。你可以看到这篇文章的源代码

介绍

以下文档的内容涉及建立 DRBD。主模式 (双主 ) 与 OCFS 文件系统 2.
我们将使用示例中 服务器之后 s :

  • 服务器 n �1:
    • 名称 : TestDRBD 01
    • IP : 10.0.0.100
  • 服务器 n �1:
    • 名称 : TestDRBD02
    • IP: 10.0.0.200

使用的磁盘任命 /dev/sdb 和使用上的每个分区 服务器s /dev/sdb1.

安装

有必要为此成立,着手安装程序包 DRBD :

apt-get install -y drbd8-utils

然后安装软件包中的文件系统执行 :

apt-get install -y ocfs2-tools

配置和执行 DRBD

操作的第一阶段包括的配置我们 资源 DRBD.
我们,在示例中,创建以下文件 : /etc/drbd.d/testdrbd.res
后者包含下列行 (做两个 服务器s):

resource testdrbd {
    meta-disk internal;
    device /dev/drbd1;
    disk /dev/sdb1;

    syncer { 
                # Limitation de la bande passante 
                rate 1000M; 
                }
    net {
                # Cette option doit être mise en place 只有  un système de fichier clusterisé.
                allow-two-primaries;

                # Configuration à utiliser dans le cadre d'une configuration primaire-primaire.
                # Plus d'information sur la page suivante: https://drbd.linbit.com/users-guide/s-configure-split-brain-behavior.html
                after-sb-0pri discard-zero-changes;
                after-sb-1pri discard-secondary;
                after-sb-2pri disconnect;
        }
     startup { 
                 # Indique que les deux nodes doivent être primaire lors du démarrage.
                 become-primary-on both; 
                 }

    # Configuration des deux nodes 
    on TestDRBD01 { address 10.0.0.100:7789; }
    on TestDRBD02 { address 10.0.0.200:7789; }
}

下一步是做操作和资源 DRBD 推出 :

drbdadm create-md testdrbd 

modprobe drbd
drbdadm up testdrbd
  • 可以执行此操作的第一 服务器 uniquement:
drbdadm -- --overwrite-data-of-peer primary testdrbd 
  • 你现在必须等到同步结束,这是通过命令可核查 :
cat /proc/drbd
  • 您的配置是目前在小学中学模式下,迫使第二个节点中的主要模式通过命令 :
drbdadm primary testdrbd

配置和文件系统的实现 (OCFS2)

通过定义 OCFS 群集的配置文件创建配置的第一阶段 2.
在示例中,我们指定下列文件中的配置 : /etc/ocfs2/cluster.conf

cluster:
    node_count = 2
    name = testdrbd

node:
    ip_port = 7777
    ip_address = 10.0.0.100
    number = 1
    name = TestDRBD01
    cluster = testdrbd

node:
    ip_port = 7777
    ip_address = 10.0.0.200
    number = 2
    name = TestDRBD02
    cluster = testdrbd

然后有必要修改的程序包 ocfs 配置 2-通过命令工具 :

dpkg-reconfigure ocfs2-tools

之后,你才实用程序会问几个问题,你回答 :

  • 是啊 关于问题 : "负荷 O 2CB 上引导驱动程序 ",
  • testdrbd 关于问题 : "群集启动开机 ",
  • 保留默认选项为其他问题。

OCFS 服务目前已停止,您必须执行以下两个 服务器s:

/etc/init.d/o2cb start 
/etc/init.d/ocfs2 start
/etc/init.d/o2cb enable

文件系统的最后一步是通过我们 drbd 资源的格式 :

mkfs.ocfs2 -L "testdrbd" /dev/drbd1

你可以现在通常装入您的系统并且甚至表明在 fstab 文件中。



这篇文章似乎你要有用 ?

0



您未被允许发表评论。