Pacemaker
CRIANDO CLUSTER
VMs (VMWARE)
habilitar o serviço pcsd
# systemctl enable pcsd.service
List of UUID of VMs para plug
# fence_vmware_soap -a '<ip_vcenter>' -l 'administrator@vsphere.local' -p '<password_admin_vsphere>' -o list -t -z --ssl-insecure
Status do servidor virtual
# fence_vmware_soap -a '<ip_vcenter>' -l 'administrator@vsphere.local' -p '<password_admin_vsphere>' -t -z --ssl-insecure -n "<UUID vm server>" -o status
Criando Stonith (Fence)
Executar para todos os nós do cluster
# pcs stonith create vmware-fence-node1 fence_vmware_soap port='caminho dentro do VMWARE' ipaddr='<IP_VCENTER>' login='administrator@vsphere.local' passwd='<senha administrator>' plug='<UUID da VM>' pcmk_host_list='<hostname_VM>' ip='<IP_VM>' username='root' ssl='1' ssl_insecure='1' notls='1'
EXEMPLO
#pcs stonith create vmware-fence-node1 fence_vmware_soap port='/VCENTER/vm/FOO/node1' ipaddr='192.168.0.253' login='administrator@vsphere.local' passwd='Vmware1!' plug='4236e93f-c058-4bc6-b58c-2d9a-e84b3cf6' pcmk_host_list='node1' ip='192.168.0.1' username='root' ssl='1' ssl_insecure='1' notls='1'
pcs status -> mostra os recursos do cluster
pcs resource disable -> para os serviços do recurso
pcs resource enable -> inicia os serviços do recurso
Criando recurso do VG
REFERENCIAS
https://www.golinuxcloud.com/configure-ha-lvm-cluster-resource-linux/
VMs (VMWARE)
Editar o arquivo hosts
# vi
/etc/hosts
192.168.0.1 node1
192.168.0.2 Snode2
192.168.0.3 ip-vip
Instalação dos pacotes
# yum install pcs pacemaker fence-agents-all
# yum install pcs pacemaker fence-agents-all
Criar senha user hacluster
# passwd hacluster
# passwd hacluster
Iniciar o serviço pcsd
# systemctl start pcsd.service
# systemctl start pcsd.service
habilitar o serviço pcsd
# systemctl enable pcsd.service
Autenticar nós no cluster
# pcs cluster auth node1 node2
# pcs cluster auth node1 node2
iniciar nós no cluster
# pcs cluster setup --start --name cluster node1 node2 --force
# pcs cluster setup --start --name cluster node1 node2 --force
habilitar cluster
# pcs cluster enable --all
# pcs cluster enable --all
verificar cluster
# pcs cluster status
# pcs cluster status
verificar nós/recursos
# pcs status
# pcs status
Criar recurso ip-vip
# pcs resource create virtual-ip ocf:heartbeat:IPaddr2 ip=<ip_do_vip> cidr_netmask=24 nic=<interface_rede> op monitor interval=30s --group <nome_do_grupo>
# pcs resource create virtual-ip ocf:heartbeat:IPaddr2 ip=<ip_do_vip> cidr_netmask=24 nic=<interface_rede> op monitor interval=30s --group <nome_do_grupo>
List of UUID of VMs para plug
# fence_vmware_soap -a '<ip_vcenter>' -l 'administrator@vsphere.local' -p '<password_admin_vsphere>' -o list -t -z --ssl-insecure
# fence_vmware_soap -a '<ip_vcenter>' -l 'administrator@vsphere.local' -p '<password_admin_vsphere>' -t -z --ssl-insecure -n "<UUID vm server>" -o status
Criando Stonith (Fence)
Executar para todos os nós do cluster
# pcs stonith create vmware-fence-node1 fence_vmware_soap port='caminho dentro do VMWARE' ipaddr='<IP_VCENTER>' login='administrator@vsphere.local' passwd='<senha administrator>' plug='<UUID da VM>' pcmk_host_list='<hostname_VM>' ip='<IP_VM>' username='root' ssl='1' ssl_insecure='1' notls='1'
EXEMPLO
#pcs stonith create vmware-fence-node1 fence_vmware_soap port='/VCENTER/vm/FOO/node1' ipaddr='192.168.0.253' login='administrator@vsphere.local' passwd='Vmware1!' plug='4236e93f-c058-4bc6-b58c-2d9a-e84b3cf6' pcmk_host_list='node1' ip='192.168.0.1' username='root' ssl='1' ssl_insecure='1' notls='1'
pcs status -> mostra os recursos do cluster
pcs resource disable
pcs resource enable
pcs
resource create <NOME DO RECURSO> LVM volgrpname=<NOME DO VG> --group <NOME DO GRUPO>
Criando recurso do LV
# pcs
resource create <NOME DO RECURSO> Filesystem device="/dev/mapper/VG-LV"
directory="/FILESYSTEM" fstype="<TIPO DO FS>" --group <NOME DO GRUPO>
EXEMPLO
# pcs
resource create fs-app Filesystem \
device="/dev/mapper/vg_app-lv_app"
directory="/app" fstype="ext4" --group svc01
Comentários
Postar um comentário