heartbeat (corosync) 支持多节点集群
加存储:drbd(前提:做好drbd)

crmB_0006.gif首先停掉资源
primitive drbddata ocf:linbit:drbd params drbd_resource=example op monitorinterval=60s

ms drbddataclone drbddata meta master-max=1 master-node-max=1 clone-max=2clon-node-max=1 notify=true

commit
primitive sqlfs ocf:heartbeat:Filesystem params device=/dev/drbd1directory=/var/lib/mysql fstype=ext4 op monitor interval=60s

colocation sqlfs-with-drbddata inf:sqlfs drbddataclone:Master

order sqlfs-after-drbddata inf:drbddataclone:promote sqlfs:start

commit

primitive mysql lsb:mysqld op monitor interval=60s
lvs(二) fullnat pacemaker_第1张图片
group musqlgroup vip sqlfs mysql

lvs(二) fullnat pacemaker_第2张图片

lvs(二) fullnat pacemaker_第3张图片

lvs(二) fullnat pacemaker_第4张图片


pacemaker+lvs:B_0040.gif
前提:两台real server正常 两台调度机正常
crm
之前资源删除:
stop mysqlgroup
stop drbddataclone

lvs(二) fullnat pacemaker_第5张图片
delete mysqlgroup
delete mysql
delete drbddataclone
delete sqlfs
delete sqlfs-with-drbddata
delete sqlfs-after-drbddata
delete drbddata

lvs(二) fullnat pacemaker_第6张图片
commit

primitive lvs lsb:ldirectord op monitor interval=30s
group mylvs vip lvs
commit
lvs(二) fullnat pacemaker_第7张图片
测试:

lvs(二) fullnat pacemaker_第8张图片

lvs(二) fullnat pacemaker_第9张图片

Online dd2.example.com

 

lvs(二) fullnat pacemaker_第10张图片
lvs第四种fullnat:B_0031.gif

lvs(二) fullnat pacemaker_第11张图片

lvs(二) fullnat pacemaker_第12张图片


安装软件:
重新编译内核:
rpm -ivh kernel-2.6.32-220.23.1.el6.src.rpm

lvs(二) fullnat pacemaker_第13张图片
yum install rpm-build -y
cd /root/rpmbuild/SPECS
rpmbuild -bp kernel.spec
yum install gcc redhat-rpm-config patchutils xmlto asciidocelfutils-libelf-devel zlib-devel binutils-devel newt-devel python-develperl-ExtUtils-Embed hmaccalc -y
rpm -ivh newt-devel-0.52.11-3.el6.x86_64.rpm asciidoc-8.4.5-4.1.el6.noarch.rpmslang-devel-2.2.1-1.el6.x86_64.rpm

tar zxf Lvs-fullnat-synproxy.tar.gz
cd lvs-fullnat-synproxy
cp lvs-2.6.32-220.23.1.el6.patch /root/rpmbuild/BUILD
 cp lvs-2.6.32-220.23.1.el6.patch/root/rpmbuild/BUILD/kernel-2.6.32-220.23.1.el6
 cp lvs-2.6.32-220.23.1.el6.patch/root/rpmbuild/BUILD/kernel-2.6.32-220.23.1.el6/linux-2.6.32-220.23.1.el6.x86_64/
cd rpmbuild/
cd BUILD
cd linux-2.6.32-220.23.1.el6.x86_64/
patch -p1 < lvs-2.6.32-220.23.1.el6.patch
free -m
make


make modules_install
make install
cd /boot/grub
vim grub.conf

 

lvs(二) fullnat pacemaker_第14张图片

lvs(二) fullnat pacemaker_第15张图片

lvs(二) fullnat pacemaker_第16张图片

lvs(二) fullnat pacemaker_第17张图片

lvs(二) fullnat pacemaker_第18张图片

wKiom1iwJaCQmthUAAA121FzjLM384.png-wh_50

wKioL1iwJaDSP5WgAAAuiYgW3pY404.png-wh_50


 

 

Make

Make install

 

wKiom1iwJcHx6mHvAABSIIY-S28757.png-wh_50

lvs(二) fullnat pacemaker_第19张图片

lvs(二) fullnat pacemaker_第20张图片

wKioL1iwJcXhMOw0AAClrh-7dvc674.png-wh_50