Cluster
Jump to navigation
Jump to search
- !/bin/bash
new node
nameHost=io mkdir ~/data/${nameHost} cd ~/data/${nameHost} vagrant init centos/7 vagrant up vagrant ssh
sudo su - yum -y update
Needs
vagrant plugin install vagrant-dns
storage.domain.local net.128
node1.domain.local net.129 node2.domain.local net.130
Virtual IP net.131
node1 - 192.168.1.1 node2 - 192.168.1.2
Install
ALL
nodeName=node2 hostnamectl set-hostname $nodeName yum -y install pacemaker pcs resource-agents echo CHANGEME | passwd --stdin hacluster
ONE
clusterName=pacemaker1 pcs cluster auth 192.168.121.91 192.168.121.204 -u hacluster -p CHANGEME --force pcs cluster setup --force --name $clusterName 192.168.121.91 192.168.121.204 pcs cluster start --all pcs property set stonith-enabled=false pcs property set no-quorum-policy=ignore pcs resource defaults migration-threshold=1
serviceName=my_first_svc pcs resource create $serviceName Dummy op monitor interval=120s #pcs status
Cfg
io
yum -y install targetcli targetcli
/backstores/fileio create disk1 /root/disk1 100MB /iscsi create iqn.2018-01.com.infocepo:io /iscsi/iqn.2018-01.com.infocepo:io/tpg1/acls create iqn.2018-01.com.infocepo:node1 /iscsi/iqn.2018-01.com.infocepo:io/tpg1/luns create /backstores/fileio/disk1 saveconfig exit
systemctl restart target
ip ad
node1
ipIO=192.168.121.53 yum -y install iscsi-initiator-utils vi /etc/iscsi/initiatorname.iscsi
iqn.2018-01.com.infocepo:node1
systemctl restart iscsid systemctl restart iscsi iscsiadm -m discovery -t st -p ${ipIO}:3260 iscsiadm -m node -T iqn.2018-01.com.infocepo:io -p ${ipIO}:3260 –l
selinux disable
vi /etc/selinux/config SELINUX=disabled
reboot #getenforce
iptable stop
#systemctl disable firewalld systemctl stop firewalld #systemctl status firewalld