apt install corosync pacemaker crmsh
corosync-keygen
La clé est généré dans /etc/corosync/authkey , il faudra la copié sur l'autres machine du nœud.
scp /etc/corosync/authkey root@10.0.1.2:/etc/corosync/
rm /etc/corosync/corosync.conf && vi /etc/corosync/corosync.conf
totem {
version: 2
cluster_name: cluster_web
crypto_cipher: aes256
crypto_hash: sha1
clear_node_high_bit:yes
}logging {
fileline: off
to_logfile: yes
logfile: /var/log/corosync/corosync.log
to_syslog: no
debug: off
timestamp: onlogger_subsys {
subsys: QUORUM
debug: off
}
}quorum {
provider: corosync_votequorum
expected_votes: 2
two_nodes: 1
}nodelist {
node {
name: serv1
nodeid: 1
ring0_addr: 10.0.1.1
}
node {
name: serv2
nodeid: 2
ring0_addr: 10.0.1.2
}
}service {
ver: 0
name: pacemaker
}
/etc/init.d/corosync restart
/etc/init.d/pacemaker restart
scp /etc/corosync/corosync.conf root@10.0.1.2:/etc/corosync/
Sur srv2
/etc/init.d/corosync restart
/etc/init.d/pacemaker restart
corosync-cfgtool -s
root@srv1:~# corosync-cfgtool -s
Local node ID 1, transport knet
LINK ID 0
addr = 10.0.1.1
status:
nodeid: 1: localhost
nodeid: 2: connected
A faire sur tous les serveurs
crm configure property stonith-enabled=false
crm configure property no-quorum-policy="ignore"
crm node standby
crm node online