Najprv nainštalujeme potrebné balíčky:
apt-get install corosync pacemaker
A teraz sa vrhneme do konfigurácie. Najprv povolime spuštanie corosync:
vi /etc/default/corosync # start corosync at boot [yes|no] START=yes
Teraz nastavíme sieťové nastavenia na komunikáciu medzi nódmi. Oproti defaultnej konfigurácii len zmeníme bind adresu.
vi /etc/corosync/corosync.conf totem { version: 2 token: 3000 token_retransmits_before_loss_const: 10 join: 60 consensus: 3600 vsftype: none max_messages: 20 clear_node_high_bit: yes secauth: off threads: 0 rrp_mode: none interface { ringnumber: 0 bindnetaddr: 172.16.2.12 mcastaddr: 226.94.1.1 mcastport: 5405 } } amf { mode: disabled } service { 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|leave|trace1|trace2|trace3|trace4|trace6 } }
Teraz môžeme zapnúť corosync a otestovať či sa cluster objavil.
root@nfs1:~# /etc/init.d/corosync start root@nfs2:~# /etc/init.d/corosync start root@nfs1:~# crm_mon -1 ============ Last updated: Wed May 15 13:55:23 2013 Stack: openais Current DC: nfs1.cloud.mavipet.sk - partition with quorum Version: 1.0.9-74392a28b7f31d7ddc86689598bd23114f58978b 2 Nodes configured, 2 expected votes 0 Resources configured. ============ Online: [ nfs1.cloud.mavipet.sk nfs2.cloud.mavipet.sk ]
Zatiaľ hotovo.