Difference between revisions of "Setting up DRBD in mode primary-secondary"
| Line 1: | Line 1: | ||
| + | <span data-link_translate_de_title="Einrichten von DRBD im Modus Primär-Sekundär" data-link_translate_de_url="Einrichten+von+DRBD+im+Modus+Prim%C3%A4r-Sekund%C3%A4r"></span>[[:de:Einrichten von DRBD im Modus Primär-Sekundär]][[de:Einrichten von DRBD im Modus Primär-Sekundär]] | ||
<span data-link_translate_nl_title="Opzetten van DRBD in modus primaire-secundaire" data-link_translate_nl_url="Opzetten+van+DRBD+in+modus+primaire-secundaire"></span>[[:nl:Opzetten van DRBD in modus primaire-secundaire]][[nl:Opzetten van DRBD in modus primaire-secundaire]] | <span data-link_translate_nl_title="Opzetten van DRBD in modus primaire-secundaire" data-link_translate_nl_url="Opzetten+van+DRBD+in+modus+primaire-secundaire"></span>[[:nl:Opzetten van DRBD in modus primaire-secundaire]][[nl:Opzetten van DRBD in modus primaire-secundaire]] | ||
<span data-link_translate_it_title="Configurazione DRBD in modalità primario-secondario" data-link_translate_it_url="Configurazione+DRBD+in+modalit%C3%A0+primario-secondario"></span>[[:it:Configurazione DRBD in modalità primario-secondario]][[it:Configurazione DRBD in modalità primario-secondario]] | <span data-link_translate_it_title="Configurazione DRBD in modalità primario-secondario" data-link_translate_it_url="Configurazione+DRBD+in+modalit%C3%A0+primario-secondario"></span>[[:it:Configurazione DRBD in modalità primario-secondario]][[it:Configurazione DRBD in modalità primario-secondario]] | ||
Revision as of 19:26, 8 February 2016
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 :
- 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