LinuxParty

NUESTRO SITIO necesita la publicidad para costear hosting y el dominio. Por favor considera deshabilitar tu AdBlock en nuestro sitio. También puedes hacernos una donación entrando en linuxparty.es, en la columna de la derecha.

Ratio: 5 / 5

Inicio activadoInicio activadoInicio activadoInicio activadoInicio activado
 

Este tutorial muestra cómo Configurar en red un RAID1 con la ayuda de DRBD sobre dos sistemas Debian. DRBD significa "Distributed Replicated Block Device" y permite reflejar (hacer mirror) un dispositivos de bloques en una red. Esto es útil para configuraciones de alta disponibilidad (como un servidor NFS HA) porque si un nodo falla, todos los datos aún están disponible en el otro nodo.

1 Nota Preliminar

Voy a utilizar dos servidores de aquí (tanto Debian Squeeze marcha):

  • server1.example.com (dirección IP 192.168.0.100)
  • server2.example.com (dirección IP: 192.168.0.101)

Tanto los nodos tienen un disco sin particionar segundo (/ dev / sdb) con idéntico tamaño (30 GB en este ejemplo) que desea reflejar en la red (la red de RAID 1) con la ayuda de DRBD.

Es importante que ambos nodos pueden resolver entre sí, ya sea a través de DNS o por medio de / etc / hosts. Si usted aún no ha creado los registros de DNS para server1.example.com y server2.example.com, puede modificar / etc / hosts en ambos nodos de la siguiente manera:

server1/server2:

vi / etc / hosts

  127.0.0.1 localhost localhost
 192.168.0.100 server1.example.com server1
 192.168.0.101 server2.example.com server2
 # Las siguientes líneas son recomendables para los equipos que pueden IPv6
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

2 sincronizar la hora

server1/server2:

Es muy importante que ambos nodos tienen el mismo tiempo. Por lo tanto, instalar los paquetes de ntp:

apt-get install ntp ntpdate

3 particiones /dev/sdb

server1/server2:

Ahora mismo, nuestra división es como sigue:

fdisk -l

root@server1:~# fdisk -l

Disk /dev/sda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00029d5c

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        3793    30461952   83  Linux
/dev/sda2            3793        3917      992257    5  Extended
/dev/sda5            3793        3917      992256   82  Linux swap / Solaris

Disk /dev/sdb: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/sdb doesn't contain a valid partition table
root@server1:~#

Como se ve, /dev/sdbno está dividido. Nosotros cambiamos eso ahora y crear una partición más grande en él, / dev/sdb1:

fdisk /dev/sdb

root@server1:~# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x8042e800.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): <-- n
Command action
   e   extended
   p   primary partition (1-4)
<-- p
Partition number (1-4): <-- 1
First cylinder (1-3916, default 1): <-- ENTER
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-3916, default 3916): <-- ENTER
Using default value 3916

Command (m for help): <-- t
Selected partition 1
Hex code (type L to list codes): <-- 83

Command (m for help): <-- w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
root@server1:~#

Ahora ejecute

fdisk -l

de nuevo, y usted debe encontrar /dev/sdb1 en la salida:

root@server1:~# fdisk -l

Disk /dev/sda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00029d5c

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        3793    30461952   83  Linux
/dev/sda2            3793        3917      992257    5  Extended
/dev/sda5            3793        3917      992256   82  Linux swap / Solaris

Disk /dev/sdb: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x78f21e78

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        3916    31455238+  83  Linux
root@server1:~#


Continúa aquí: Configurar un servidor RAID1 en Red con DRBD en Linux (2 de 2)


 

Pin It

Escribir un comentario


Código de seguridad
Refescar



Redes:



 

Suscribete / Newsletter

Suscribete a nuestras Newsletter y periódicamente recibirás un resumen de las noticias publicadas.

Donar a LinuxParty

Probablemente te niegues, pero.. ¿Podrías ayudarnos con una donación?


Tutorial de Linux

Filtro por Categorías