Serveur Vmware Haute Disponibilité

De $1

 

Introduction

-- En cours --

Procédure

Installation Ubuntu serveur 8.04

Mises à jour

apt-get update

apt-get dist-upgrade

reboot

  • Les paquets :
    • Installation de Webmin
apt-get install libnet-ssleay-perl libauthen-pam-perl libio-pty-perl libmd5-perl openssl

dpkg --install webmin"version".deb
    • Les indispensables :
uname -r # Pour connaître la version du noyau #

apt-get install xinetd nfs-common build-essential mc

apt-get install linux-headers-`version de votre noyau`

Heartbeat

apt-get install heartbeat

Drbd

cat /proc/drbd

reponse :

/proc/drbd: Aucun fichier ou répertoire de ce type

 

modprobe drbd

cat /proc/drbd

Reponse :

version: 8.0.11 (api:86/proto:86)
GIT-hash: b3fe2bdfd3b9f7c2f923186883eb9e2a0d3a5b1b build by phil@mescal, 2008-02-12 11:56:43

 

  • Installation des utilitaires drbd

 

apt-get install drbd8-utils
  • Finalisation pour faire en sorte que les outils heartbeat fonctionnent :
chgrp haclient /sbin/drbdsetup
chmod o-x /sbin/drbdsetup
chmod u+s /sbin/drbdsetup

chgrp haclient /sbin/drbdmeta
chmod o-x /sbin/drbdmeta
chmod u+s /sbin/drbdmeta

drbd.conf

#
# drbd.conf example
#
# parameters you _need_ to change are the hostname, device, disk,
# meta-disk, address and port in the "on <hostname> {}" sections.
#
# you ought to know about the protocol, and the various timeouts.
#
# you probably want to set the rate in the syncer sections

#
# NOTE common pitfall:
# rate is given in units of _byte_ not bit
#

#
# increase timeout and maybe ping-int in net{}, if you see
# problems with "connection lost/connection established"
# (or change your setup to reduce network latency; make sure full
#  duplex behaves as such; check average roundtrip times while
#  network is saturated; and so on ...)
#

skip {
  As you can see, you can also comment chunks of text
  with a 'skip[optional nonsense]{ skipped text }' section.
  This comes in handy, if you just want to comment out
  some 'resource <some name> {...}' section:
  just precede it with 'skip'.

  The basic format of option assignment is
  <option name><linear whitespace><value>;

  It should be obvious from the examples below,
  but if you really care to know the details:

  <option name> :=
        valid options in the respective scope
  <value>  := <num>|<string>|<choice>|...
              depending on the set of allowed values
              for the respective option.
  <num>    := [0-9]+, sometimes with an optional suffix of K,M,G
  <string> := (<name>|\"([^\"\\\n]*|\\.)*\")+
  <name>   := [/_.A-Za-z0-9-]+
}

#
# At most ONE global section is allowed.
# It must precede any resource section.
#
global {
    # By default we load the module with a minor-count of 32. In case you
    # have more devices in your config, the module gets loaded with
    # a minor-count that ensures that you have 10 minors spare.
    # In case 10 spare minors are too little for you, you can set the
    # minor-count exeplicit here. ( Note, in contrast to DRBD-0.7 an
    # unused, spare minor has only a very little overhead of allocated
    # memory (a single pointer to be exact). )
    #
    # minor-count 64;

    # The user dialog counts and displays the seconds it waited so
    # far. You might want to disable this if you have the console
    # of your server connected to a serial terminal server with
    # limited logging capacity.
    # The Dialog will print the count each 'dialog-refresh' seconds,
    # set it to 0 to disable redrawing completely. [ default = 1 ]
    #
    # dialog-refresh 5; # 5 seconds

    # You might disable one of drbdadm's sanity check.
    # disable-ip-verification;

    # Participate in DRBD's online usage counter at http://usage.drbd.org
    # possilbe options: ask, yes, no. Default is ask. In case you do not
    # know, set it to ask, and follow the on screen instructions later.
    usage-count yes;
}


#
# The common section can have all the sections a resource can have but
# not the host section (started with the "on" keyword).
# The common section must precede all resources.
# All resources inherit the settings from the common section.
# Whereas settings in the resources have precedence over the common
# setting.
#

common {
  syncer { rate 100M; }
}

#
# this need not be r#, you may use phony resource names,
# like "resource web" or "resource mail", too
#

resource r0 {
  protocol	C;

  startup { wfc-timeout	0; degr-wfc-timeout	120; }
  disk { on-io-error detach; }
  syncer {
  }
  on test01 {
    device	/dev/drbd0;
    disk	/dev/sda3;
    address	192.168.0.10:7791;
    meta-disk	internal;
  }
  on test02 {
    device	/dev/drbd0;
    disk	/dev/sda3;
    address	192.168.0.11:7791;
    meta-disk	internal;
  }
}

 

Sur les 2 serveurs

drbdadm create-md r0
modprobe drbd
drbdadm up r0

 

cat /proc/drbd
version: 8.0.11 (api:86/proto:86)
GIT-hash: b3fe2bdfd3b9f7c2f923186883eb9e2a0d3a5b1b build by phil@mescal, 2008-02-12 11:56:43
 0: cs:Connected st:Secondary/Secondary ds:Inconsistent/Inconsistent C r---
    ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0
	resync: used:0/31 hits:0 misses:0 starving:0 dirty:0 changed:0
	act_log: used:0/127 hits:0 misses:0 starving:0 dirty:0 changed:0
drbdadm state r0

Reponse

Secondary/Secondary

Sur le serveur principal

drbdadm -- --overwrite-data-of-peer primary r0

cat /proc/drbd

Reponse

version: 8.0.11 (api:86/proto:86)
GIT-hash: b3fe2bdfd3b9f7c2f923186883eb9e2a0d3a5b1b build by phil@mescal, 2008-02-12 11:56:43
 0: cs:SyncSource st:Primary/Secondary ds:UpToDate/Inconsistent C r---
    ns:51994024 nr:0 dw:0 dr:52010368 al:0 bm:3172 lo:1 pe:260 ua:256 ap:0
	[======>.............] sync'ed: 38.3% (78964/127927)M
	finish: 0:27:10 speed: 49,568 (55,584) K/sec
	resync: used:1/31 hits:3246695 misses:3176 starving:0 dirty:0 changed:3176
	act_log: used:0/127 hits:0 misses:0 starving:0 dirty:0 changed:0

Attendre que ca se termine ...

 

version: 8.0.11 (api:86/proto:86)
GIT-hash: b3fe2bdfd3b9f7c2f923186883eb9e2a0d3a5b1b build by phil@mescal, 2008-02-12 11:56:43
 0: cs:Connected st:Primary/Secondary ds:UpToDate/UpToDate C r---
    ns:132845628 nr:0 dw:0 dr:132853808 al:0 bm:8109 lo:0 pe:0 ua:0 ap:0
	resync: used:0/31 hits:8294991 misses:8111 starving:0 dirty:0 changed:8111
	act_log: used:0/127 hits:0 misses:0 starving:0 dirty:0 changed:0

Formatage de la partition

mkfs.ext3 /dev/drbd0


Reponse :

mke2fs 1.40.8 (13-Mar-2008)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
8306688 inodes, 33211356 blocks
1660567 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
1014 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
	4096000, 7962624, 11239424, 20480000, 23887872

Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 31 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

Montage de la partition

mkdir /home/Machines

mount /dev/drbd0 /home/Machines

Configuration de Heartbeat

 
Images (0)
 
Commentaires (0)
Vous devez être connecté pour poster un commentaire.