Installation et Configuration de Pacemaker

From Deimos.fr / Bloc Notes Informatique
Revision as of 22:41, 21 December 2010 by Deimos (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents


1 Introduction

Pacemaker est la suite logique de Heartbeat qui a fusionné avec d'autres logiciels libre afin d'arriver à une perfection. Pacemaker est donc un logiciel de gestion de ressources. Il doit être couplé à Corosync qui lui va gérer les échanges d'informations entre noeuds.

L'installation et la configuration est faites ici sur une Debian 6.

2 Installation

Pour l'installation, rien de plus simple sur une Debian :

Command aptitude
aptitude install pacemaker corosync

3 Configuration

3.1 Corosync

Pour la configuration de Corosync, nous allons avoir besoin de générer des clefs de cryptage pour l'échange d'informations intra clusters (entre les noeuds) :

Command corosync-keygen
  1. > corosync-keygen
  2. Corosync Cluster Engine Authentication key generator.
  3. Gathering 1024 bits for key from /dev/random.
  4. Press keys on your keyboard to generate entropy.
  5. Press keys on your keyboard to generate entropy (bits = 136).
  6. Press keys on your keyboard to generate entropy (bits = 200).
  7. Press keys on your keyboard to generate entropy (bits = 264).
  8. Press keys on your keyboard to generate entropy (bits = 328).
  9. Press keys on your keyboard to generate entropy (bits = 392).
  10. Press keys on your keyboard to generate entropy (bits = 456).
  11. Press keys on your keyboard to generate entropy (bits = 520).
  12. Press keys on your keyboard to generate entropy (bits = 584).
  13. Press keys on your keyboard to generate entropy (bits = 648).
  14. Press keys on your keyboard to generate entropy (bits = 712).
  15. Press keys on your keyboard to generate entropy (bits = 776).
  16. Press keys on your keyboard to generate entropy (bits = 840).
  17. Press keys on your keyboard to generate entropy (bits = 904).
  18. Press keys on your keyboard to generate entropy (bits = 968).
  19. Writing corosync key to /etc/corosync/authkey.

Envoyez ensuite avec un scp par exemple cette configuration vers les autres nodes :

Command scp
scp -r /etc/corosync root@nodex:/etc/

Ensuite éditez sur chacun des noeuds, le fichier de configuration de Corosync et adaptez la partie réseaux à chacun d'eux :

Configuration File /etc/corosync/corosync.conf
# Please read the openais.conf.5 manual page

totem {
    version: 2

    # How long before declaring a token lost (ms)
    token: 3000

    # How many token retransmits before forming a new configuration
    token_retransmits_before_loss_const: 10

    # How long to wait for join messages in the membership protocol (ms)
    join: 60

    # How long to wait for consensus to be achieved before starting a new round of membership configuration (ms)
    consensus: 3600

    # Turn off the virtual synchrony filter
    vsftype: none

    # Number of messages that may be sent by one processor on receipt of the token
    max_messages: 20

    # Limit generated nodeids to 31-bits (positive signed integers)
    clear_node_high_bit: yes

    # Disable encryption
    secauth: off

    # How many threads to use for encryption/decryption
    threads: 0

    # Optionally assign a fixed node id (integer)
    # nodeid: 1234

    # This specifies the mode of redundant ring, which may be none, active, or passive.
    rrp_mode: none

    interface {
        # The following values need to be set based on your environment 
        ringnumber: 0
        bindnetaddr: 192.168.20.4
        mcastaddr: 226.94.1.1
        mcastport: 5405
    }
}

amf {
    mode: disabled
}

service {
    # Load the Pacemaker Cluster Resource Manager
    ver:       0
    name:      pacemaker
}

aisexec {
        user:   root
        group:  root
}

logging {
        fileline: off
        to_stderr: yes
        to_logfile: no
        to_syslog: yes
    syslog_facility: daemon
        debug: off
        timestamp: on
        logger_subsys {
                subsys: AMF
                debug: off
                tags: enter

Pour finir, éditez le fichier /etc/default/corosync afin de lui dire qu'il faut qu'il démarre au boot de la machine :

Configuration File /etc/default/corosync
  1.  # start corosync at boot [yes|no]
  2.  START=yes

Maintenant activons notre nouvelle configuration sur tous les noeuds :

Command
/etc/init.d/corosync restart

Maintenant on peut vérifier l'état du cluster :

Command crm_mon
  1. > crm_mon --one-shot -V
  2. crm_mon[427]: 2010/12/20_21:51:54 ERROR: unpack_resources: Resource start-up disabled since no STONITH resources have been defined
  3. crm_mon[427]: 2010/12/20_21:51:54 ERROR: unpack_resources: Either configure some or disable STONITH with the stonith-enabled option
  4. crm_mon[427]: 2010/12/20_21:51:54 ERROR: unpack_resources: NOTE: Clusters with shared data need STONITH to ensure data integrity
  5. ============
  6. Last updated: Mon Dec 20 21:51:54 2010
  7. Stack: openais
  8. Current DC: zazu - partition WITHOUT quorum
  9. Version: 1.0.9-74392a28b7f31d7ddc86689598bd23114f58978b
  10. 2 Nodes configured, 2 expected votes
  11. 0 Resources configured.
  12. ============
  13.  
  14. Online: [ zazu shenzi ]

Maintenant nous allons configurer quelques choses :

  • Pas de quorum (car cluster à 2 noeuds)
  • Pas de Stonith (Fencing)
  • Pour le stickness, c'est pour ne pas avoir de ressource en auto-failback
Command crm
  1. > crm
  2. crm(live)# configure
  3. crm(live)configure# property no-quorum-policy=ignore
  4. crm(live)configure# property stonith-enabled=false
  5. crm(live)configure# property default-resource-stickiness=1000
  6. crm(live)configure# commit
  7. crm(live)configure# bye

Personal tools
Namespaces

Variants
Actions
navigation et RSS
Menu
Liens
Projets/Contribs
Google Search
Translate
Toolbox