radeksmg icon

Pacemaker setup 3 nodes

radeksmg | PRO | 02/09/21 07:31:02 AM UTC (Edited) | 0 ⭐ | 1494 👁️ | Never ⏰ | []
Bash |

2.62 KB

|

None

|

0 👍

/

0 👎

nmcli connection modify enp1s0 ipv4.addresses 192.168.122.100/24 ipv4.dns 192.168.14.14 ipv4.gateway 192.168.122.1 ipv4.dns-search kresy.local ipv4.method static
nmcli connection modify enp1s0 ipv6.addresses fd00:f00c::c0a8:e100/64 ipv6.dns fd00:f00c::c0a8:e14 ipv6.dns-search kresy.local ipv6.method static
hostnamectl set-hostname --static pcmk0.kresy.local
systemctl  reboot
 
nmcli connection modify enp1s0 ipv4.addresses 192.168.122.101/24 ipv4.dns 192.168.14.14 ipv4.gateway 192.168.122.1 ipv4.dns-search kresy.local ipv4.method static
nmcli connection modify enp1s0 ipv6.addresses fd00:f00c::c0a8:e101/64 ipv6.dns fd00:f00c::c0a8:e14 ipv6.dns-search kresy.local ipv6.method static
hostnamectl set-hostname --static pcmk1.kresy.local
systemctl  reboot
 
nmcli connection modify enp1s0 ipv4.addresses 192.168.122.102/24 ipv4.dns 192.168.14.14 ipv4.gateway 192.168.122.1 ipv4.dns-search kresy.local ipv4.method static
nmcli connection modify enp1s0 ipv6.addresses fd00:f00c::c0a8:e102/64 ipv6.dns fd00:f00c::c0a8:e14 ipv6.dns-search kresy.local ipv6.method static
hostnamectl set-hostname --static pcmk2.kresy.local
systemctl  reboot
 
192.168.122.100 pcmk0.kresy.local pcmk0
192.168.122.101 pcmk1.kresy.local pcmk1
192.168.122.102 pcmk2.kresy.local pcmk2
 
 
rm -vf /etc/yum.repos.d/centos.repo 
cat << EOF >> /etc/yum.repos.d/centos.repo
[centos-7-custom]
name=CentOS-$releasever - Base
baseurl=http://ftp.agh.edu.pl/centos/8.2.2004/BaseOS/x86_64/os/
enabled=1
EOF
 
 
sed  -i s/^enabled=.*/"enabled=1"/g /etc/yum.repos.d/CentOS-HA.repo
 
yum update
 
 
dnf install \
    nmap-ncat.x86_64 tcpdump \
    pacemaker.x86_64  pacemaker-libs.x86_64  pacemaker-doc.noarch  \
    pacemaker-libs-devel.x86_64  pacemaker-cluster-libs.x86_64  \
    pacemaker-remote.x86_64 pacemaker-cli.x86_64 pcs-snmp.x86_64  \
    pcs.x86_64
 
firewall-cmd --set-default-zone trusted
 
systemctl enable pacemaker corosync pcsd
systemctl start pcsd
systemctl status pcsd
 
echo jkbfd9h43bkjbasfdoq7832gofli | passwd --stdin hacluster
pcs host auth -u hacluster -p jkbfd9h43bkjbasfdoq7832gofli pcmk1 pcmk2
 
pcs cluster setup ha-cluster pcmk0 pcmk1 pcmk2 --enable --start  --force
pcs property set stonith-enabled=false
 
pcs resource create my_first_svc ocf:heartbeat:Dummy  op monitor interval=90s
pcs resource create my_second_svc ocf:pacemaker:Dummy  op monitor interval=120s
 
pcs resource create vip201 ocf:heartbeat:IPaddr2 ip=192.168.122.201 cidr_netmask=24 op monitor interval=15s
 
 
 
# Add/remove cluster member
pcs cluster node remove  overcloud-controller-purplecloud-0
pcs cluster node add  --start --enable  overcloud-controller-purplecloud-0
 

Comments