Establishment of DRBD-primary mode with OCFS2

From EN Ikoula wiki
⧼vector-jumptonavigation⧽ ⧼vector-jumptosearch⧽
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.

en:Establishment of DRBD-primary mode with OCFS2 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 zh:与 OCFS2 DRBD 小学模式的建立 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 fr:Mise en place de DRBD en mode primaire-primaire avec OCFS2

This article has been created by an automatic translation software. You can view the article source here.

Introduction

The documentation below concerns the establishment of DRBD-primary mode (dual-primary ) with the system of OCFS file 2.
We will use in the example the Serverfollowing s :

  • Server n �1:
    • Name : TestDRBD 01
    • IP : 10.0.0.100
  • Server n �1:
    • Name : TestDRBD02
    • IP: 10.0.0.200

The disk used is appointing /dev/sdb and the partition used on each of Servers /dev/sdb1.

Installation

It is necessary for this establishment, to proceed with the installation of package DRBD :

apt-get install -y drbd8-utils

Then the installation of the package for the implementation of the file system :

apt-get install -y ocfs2-tools

Configuration and implementation of DRBD

The first stage of the operation consists of the configuration of our resource DRBD.
We are, in the example, create the following file : /etc/drbd.d/testdrbd.res
The latter containing the following lines (do the two Servers):

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 only  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; }
}

The next step is to do the manipulations and the launch of the resources DRBD :

  • Operation to do on both Servers:
drbdadm create-md testdrbd 

modprobe drbd
drbdadm up testdrbd
  • Can do this operation on the first Server uniquement:
drbdadm -- --overwrite-data-of-peer primary testdrbd 
  • You must now wait until the end of synchronization, this is verifiable via the command :
cat /proc/drbd
  • Your configuration is currently in elementary-secondary mode, forcing the second node in the primary mode is done via the command :
drbdadm primary testdrbd

Configuration and implementation of the system of file (OCFS2)

The first stage of configuration through the creation of the configuration file defining the OCFS cluster 2.
In the example, we specify the configuration in the following file : /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

It is then necessary to modify the configuration of package ocfs 2-tools via the command :

dpkg-reconfigure ocfs2-tools

The utility will then you ask several questions, you answer :

  • Yes on the issue : "Load O 2CB driver on boot ",
  • testdrbd on the issue : "Cluster to start on boot ",
  • Leave the default options for other issues.

OCFS services are currently stopped, you must do the following on the two Servers:

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

The last step for the file system is the formatting of our drbd resources via :

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

You can now mount your system normally and even indicate in your fstab file.



This article seemed you to be useful ?

0



You are not allowed to post comments.