为了初步了解openstack controller ha的工作原理,搭建测试环境进行学习。
在学习该方面知识时,当前采用的操作系统版本是centos 7.1 x64。
首先在ESXi中建立2台用于测试的虚机,最小化安装完成centos,配置IP分别为10.0.0.12、10.0.0.13,主机名分别为controller2、controller3。
关闭防火墙:
# systemctl stop firewalld
# systemctl disable firewalld
修改主机名:
# hostnamectl set-hostname controller2
升级系统至最新版本(升级至centos 7.1)并重启:
# yum update -y
下载pacemaker组件的repo文件:
# cd /etc/yum.repos.d
# wget http://download.opensuse.org/repositories/network:/ha-clustering:/Stable/CentOS_CentOS-7/network:ha-clustering:Stable.repo
安装相关软件:
# yum install -y wget
# yum install -y yum-plugin-priorities
# yum install -y openstack-selinux
# yum install -y ntp
# yum install -y pacemaker crmsh corosync cluster-glue resource-agents
# yum install -y haproxy
配置/etc/hosts:
10.0.0.11 controller
10.0.0.12 controller2
10.0.0.13 controller3
配置NTP时间同步:
# vi /etc/ntp.conf
找到ntp.conf中指定server的部分,注释原文,增加测试环境中的NTP服务器(10.0.0.11):
21 #server 0.centos.pool.ntp.org iburst
22 #server 1.centos.pool.ntp.org iburst
23 #server 2.centos.pool.ntp.org iburst
24 #server 3.centos.pool.ntp.org iburst
25 server controller iburst
启动ntp服务:
# systemctl enable ntpd.service
# systemctl start ntpd.service
验证ntp工作正常:
# ntpq -c peers
remote refid st t when poll reach delay offset jitter
==============================================================================
*controller LOCAL(0) 6 u 65 128 377 0.213 -0.620 0.040
# ntpq -c assoc
ind assid status conf reach auth condition last_event cnt
===========================================================
1 9233 965a yes yes none sys.peer sys_peer 5
相关资料地址:
高可用实现官网描述地址:
http://docs.openstack.org/ha-guide/controller-ha.html
写得很好的openstack高可用博文:
http://www.cnblogs.com/sammyliu/p/4741967.html
CRM中的几个基本概念:
http://www.toxingwang.com/linux-unix/haorlb/1660.html
HAProxy 1.5官方文档:
http://cbonte.github.io/haproxy-dconv/configuration-1.5.html
HAProxy + Pacemaker实现MySQL的高可用负载均衡:
http://www.zrwm.com/?cat=166