-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPacemaker_CentOs_7.bash
More file actions
60 lines (37 loc) · 1.6 KB
/
Pacemaker_CentOs_7.bash
File metadata and controls
60 lines (37 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
##########################
###Pacemaker - CentOS 7###
##########################
#####Preparação#####
####Ambos os nós#### {
##Configurar hostname
hostnamectl set-hostname pacemaker1 --static
##Gerar chaves
ssh-keygen -t rsa
ssh-copyid "ip nó"
####Populando o arquivo de configuração do Corosync (Ambos os nós)
pcs cluster setup --local --name cluster1 pacemaker1 pacemaker2
##Iniciando os serviços
systemctl start corosync
systemctl start pacemaker
##Checando Firewall
firewall-cmd --state
##Adicionando exceção para serviços de alta disponibilidade
firewall-cmd --permanent --add-service=high-availability
##Reload firewall para aplicar alterações
firewall-cmd --reload
##Setar Autenticação entre os dois nós (ambos os nós)
pcs cluster auth pacemaker1 pacemaker2 -force
##habilitar cluster e inicializá-lo
pcs cluster enable --all
pcs cluster start --all
#Habilitar serviço na inicialização
systemctl enable corosync.service
systemctl enable pacemaker.service
#desabilitar Quorum - Checagem que serve para chegar se mais da metade dos nodes estão online. Como o firewall só tem dois nós, não faz sentido manter habilitado.
pcs property set no-quorum-policy=ignore
##Importante, setar STONISH como false a não ser que seja criado um contexto para cada ressource
pcs property set stonith-enabled=false
###Criar ressource de vIP para o cluster (Somente em um nó):
pcs resource create cluster_vip ocf:heartbeat:IPaddr2 nic=eth1:1 ip=192.168.100.3 cidr_netmask=24 op monitor interval=20s
pcs resource debug-start cluster_vip
}