Difference between revisions of "Setting up DRBD in mode primary-secondary"

From EN Ikoula wiki
⧼vector-jumptonavigation⧽ ⧼vector-jumptosearch⧽
Line 1: Line 1:
 +
<span data-link_translate_ja_title="プライマリ-セカンダリ モードで DRBD のセットアップ"  data-link_translate_ja_url="%E3%83%97%E3%83%A9%E3%82%A4%E3%83%9E%E3%83%AA-%E3%82%BB%E3%82%AB%E3%83%B3%E3%83%80%E3%83%AA+%E3%83%A2%E3%83%BC%E3%83%89%E3%81%A7+DRBD+%E3%81%AE%E3%82%BB%E3%83%83%E3%83%88%E3%82%A2%E3%83%83%E3%83%97"></span>[[:ja:プライマリ-セカンダリ モードで DRBD のセットアップ]][[ja:プライマリ-セカンダリ モードで DRBD のセットアップ]]
 
<span data-link_translate_ar_title="إعداد DRBD في الوضع الابتدائي-الثانوي"  data-link_translate_ar_url="%D8%A5%D8%B9%D8%AF%D8%A7%D8%AF+DRBD+%D9%81%D9%8A+%D8%A7%D9%84%D9%88%D8%B6%D8%B9+%D8%A7%D9%84%D8%A7%D8%A8%D8%AA%D8%AF%D8%A7%D8%A6%D9%8A-%D8%A7%D9%84%D8%AB%D8%A7%D9%86%D9%88%D9%8A"></span>[[:ar:إعداد DRBD في الوضع الابتدائي-الثانوي]][[ar:إعداد DRBD في الوضع الابتدائي-الثانوي]]
 
<span data-link_translate_ar_title="إعداد DRBD في الوضع الابتدائي-الثانوي"  data-link_translate_ar_url="%D8%A5%D8%B9%D8%AF%D8%A7%D8%AF+DRBD+%D9%81%D9%8A+%D8%A7%D9%84%D9%88%D8%B6%D8%B9+%D8%A7%D9%84%D8%A7%D8%A8%D8%AA%D8%AF%D8%A7%D8%A6%D9%8A-%D8%A7%D9%84%D8%AB%D8%A7%D9%86%D9%88%D9%8A"></span>[[:ar:إعداد DRBD في الوضع الابتدائي-الثانوي]][[ar:إعداد DRBD في الوضع الابتدائي-الثانوي]]
 
<span data-link_translate_zh_title="DRBD 在小学中学在模式设置"  data-link_translate_zh_url="DRBD+%E5%9C%A8%E5%B0%8F%E5%AD%A6%E4%B8%AD%E5%AD%A6%E5%9C%A8%E6%A8%A1%E5%BC%8F%E8%AE%BE%E7%BD%AE"></span>[[:zh:DRBD 在小学中学在模式设置]][[zh:DRBD 在小学中学在模式设置]]
 
<span data-link_translate_zh_title="DRBD 在小学中学在模式设置"  data-link_translate_zh_url="DRBD+%E5%9C%A8%E5%B0%8F%E5%AD%A6%E4%B8%AD%E5%AD%A6%E5%9C%A8%E6%A8%A1%E5%BC%8F%E8%AE%BE%E7%BD%AE"></span>[[:zh:DRBD 在小学中学在模式设置]][[zh:DRBD 在小学中学在模式设置]]

Revision as of 20:26, 8 February 2016

ja:プライマリ-セカンダリ モードで DRBD のセットアップ ar:إعداد DRBD في الوضع الابتدائي-الثانوي zh:DRBD 在小学中学在模式设置 de:Einrichten von DRBD im Modus Primär-Sekundär nl:Opzetten van DRBD in modus primaire-secundaire it:Configurazione DRBD in modalità primario-secondario pt:Configurando o DRBD no modo primário-secundário es:Configurar DRBD en modo primario-secundario fr:Mise en place de DRBD en mode primaire-secondaire

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

Introduction

The documentation below concerns the setting up DRBD in elementary-secondary mode with the ext filesystem 4.
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

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;
  syncer {
    verify-alg sha1;
  }
  net {
    allow-two-primaries;
  }

  on TestDRBD01 {
    disk /dev/sdb1;
    address 10.0.0.100:7789;
  }

  on TestDRBD02 {
    disk /dev/sdb1;
    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 only :
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

Configuration and implementation of the system of file (Ext 4)

Now you can just format your drbd resources in order to use it, then the mount :

mkfs.ext4 /dev/drbd1
mount /dev/drbd1 /mnt

Toggle between the two Servers

This primary-secondary-mode configuration you prevents to mount the drbd on both resources Servers.
As such, here is the method to switch between the two mounting Servers :

umount /dev/drbd1
drbdadm secondary testdrbd
  • On the Server secondary (new primary ):
drbdadm primary testdrbd
mount /dev/drbd1 /mnt

You have now reversed the roles of your Servers.



This article seemed you to be useful ?

0



You are not allowed to post comments.