标签:
1.解压源代码包(解压缩到 /usr/src/)
tar zxvf keepalived-1.2.18.tar.gz -C /usr/src/
2.源代码安装(在解压缩目录下)
(1)./configure
(2)make
(3)make install
3.用源代码包生成rpm包
(1)生成keepalived.spec文件及Makefile文件夹
./configure
(2)构建rpm包
rpmbuild ~
cp keepalived.spec ~/rpmbuild/SPECS/
cp keepalived-1.2.18.tar.gz ~/rpmbuild/SOURCES/
(3)进入 cd ~/rpmbuild/SPECS/ 目录
(4)编译源码并生成rpm包
rpmbuild -bb keepalived.spec
构建完成后在 /root/rpmbuild/RPMS/x86_64目录下可以找到
4.安装rpm包
rpm -ivh keepalived-1.2.18-5.x86_64.rpm
----------------搭建mysql HA----------------------
1.关闭防火墙
service iptables stop
2.将 SELinux 在 Enforcing 与 permissive 之间切换与查看(切换成permissive)
[root@www ~]# setenforce 0
[root@www ~]# getenforce Permissive
[root@www ~]# setenforce 1
[root@www ~]# getenforce Enforcing
3.配置好相应的mysql replication 后登陆mysql(a机器为 197 b机器为165)
A机器:
GRANT REPLICATION SLAVE ON *.* TO ‘slave‘@‘10.2.10.165‘ IDENTIFIED BY ‘123456‘;
flush privileges;
B机器:
GRANT REPLICATION SLAVE ON *.* TO ‘slave‘@‘10.2.10.197‘ IDENTIFIED BY ‘123456‘;
flush privileges;
配置同步
A机器:
CHANGE MASTER TO MASTER_HOST=‘10.2.10.165‘, MASTER_PORT=3306, MASTER_USER=‘slave‘,MASTER_PASSWORD=‘123456‘, master_auto_position=1;
start slave
B机器:
CHANGE MASTER TO MASTER_HOST=‘10.2.10.197‘, MASTER_PORT=3306, MASTER_USER=‘slave‘,MASTER_PASSWORD=‘123456‘, master_auto_position=1;
start slave
标签:
原文地址:http://www.cnblogs.com/Yongzhouunknown/p/4875476.html