Difference between revisions of "Setting up DRBD in mode primary-secondary"
Line 1: | Line 1: | ||
+ | <span data-link_translate_pt_title="Configurando o DRBD no modo primário-secundário" data-link_translate_pt_url="Configurando+o+DRBD+no+modo+prim%C3%A1rio-secund%C3%A1rio"></span>[[:pt:Configurando o DRBD no modo primário-secundário]][[pt:Configurando o DRBD no modo primário-secundário]] | ||
<span data-link_translate_es_title="Configurar DRBD en modo primario-secundario" data-link_translate_es_url="Configurar+DRBD+en+modo+primario-secundario"></span>[[:es:Configurar DRBD en modo primario-secundario]][[es:Configurar DRBD en modo primario-secundario]] | <span data-link_translate_es_title="Configurar DRBD en modo primario-secundario" data-link_translate_es_url="Configurar+DRBD+en+modo+primario-secundario"></span>[[:es:Configurar DRBD en modo primario-secundario]][[es:Configurar DRBD en modo primario-secundario]] | ||
<span data-link_translate_fr_title="Mise en place de DRBD en mode primaire-secondaire" data-link_translate_fr_url="Mise_en_place_de_DRBD_en_mode_primaire-secondaire"></span>[[:fr:Mise en place de DRBD en mode primaire-secondaire]][[fr:Mise en place de DRBD en mode primaire-secondaire]] | <span data-link_translate_fr_title="Mise en place de DRBD en mode primaire-secondaire" data-link_translate_fr_url="Mise_en_place_de_DRBD_en_mode_primaire-secondaire"></span>[[:fr:Mise en place de DRBD en mode primaire-secondaire]][[fr:Mise en place de DRBD en mode primaire-secondaire]] |
Revision as of 20:26, 8 February 2016
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 :
- On the Server primary :
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 ?
Enable comment auto-refresher