1、集群安装配置(pacemaker三个节点执行)
yum install -y lvm2 cifs-utils quota psmisc pcs pacemaker corosync fence-agents-all resource-agents
2、启动服务并且设置开机自启动(三个节点执行)
systemctl start pcsd
systemctl enable pcsd
3、修改管理员密码(三个节点执行)
echo 123456 | passwd --stdin hacluster
4、建立认证(三个节点执行)
pcs cluster auth controller1 controller2 controller3 -u hacluster -p 123456 --force
5、配置集群(三个节点执行)
pcs cluster setup --force --name openstack-cluster controller1 controller2 controller3
6、启动集群并且设置开机自启动
pcs cluster start --all
pcs cluster enable --all
7、查看集群状态
pcs status cluster
8、查看corosync状态
pcs status corosync
9、禁用stonith和quorum
pcs property set stonith-enabled=false
pcs property set no-quorum-policy=ignore
10、配置
pcs property set default-resource-stickiness="INFINITY"
pcs property list
验证
crm_verify -L -V
pcs property set pe-warn-series-max=1000 \
pe-input-series-max=1000 \
pe-error-series-max=1000 \
cluster-recheck-interval=5min
11、设置浮动IP
pcs resource create vip ocf:heartbeat:IPaddr2 ip=192.168.148.200 cidr_netmask=24 op monitor interval=30s
####################################################################################################################
安装haproxy
1、安装haproxy软件包、并且设置开机自启动
yum install -y haproxy
systemctl enable haproxy
2、编辑配置文件
vim /etc/haproxy/haproxy.cfg
#---------------------------------------------------------------------
# Example configuration for a possible web application. See the
# full configuration options online.
#
# http://haproxy.1wt.eu/download/1.4/doc/configuration.txt
#
#---------------------------------------------------------------------
#---------------------------------------------------------------------
# Global settings
#---------------------------------------------------------------------
global
# to have these messages end up in /var/log/haproxy.log you will
# need
yum install -y lvm2 cifs-utils quota psmisc pcs pacemaker corosync fence-agents-all resource-agents
2、启动服务并且设置开机自启动(三个节点执行)
systemctl start pcsd
systemctl enable pcsd
3、修改管理员密码(三个节点执行)
echo 123456 | passwd --stdin hacluster
4、建立认证(三个节点执行)
pcs cluster auth controller1 controller2 controller3 -u hacluster -p 123456 --force
5、配置集群(三个节点执行)
pcs cluster setup --force --name openstack-cluster controller1 controller2 controller3
6、启动集群并且设置开机自启动
pcs cluster start --all
pcs cluster enable --all
7、查看集群状态
pcs status cluster
8、查看corosync状态
pcs status corosync
9、禁用stonith和quorum
pcs property set stonith-enabled=false
pcs property set no-quorum-policy=ignore
10、配置
pcs property set default-resource-stickiness="INFINITY"
pcs property list
验证
crm_verify -L -V
pcs property set pe-warn-series-max=1000 \
pe-input-series-max=1000 \
pe-error-series-max=1000 \
cluster-recheck-interval=5min
11、设置浮动IP
pcs resource create vip ocf:heartbeat:IPaddr2 ip=192.168.148.200 cidr_netmask=24 op monitor interval=30s
####################################################################################################################
安装haproxy
1、安装haproxy软件包、并且设置开机自启动
yum install -y haproxy
systemctl enable haproxy
2、编辑配置文件
vim /etc/haproxy/haproxy.cfg
#---------------------------------------------------------------------
# Example configuration for a possible web application. See the
# full configuration options online.
#
# http://haproxy.1wt.eu/download/1.4/doc/configuration.txt
#
#---------------------------------------------------------------------
#---------------------------------------------------------------------
# Global settings
#---------------------------------------------------------------------
global
# to have these messages end up in /var/log/haproxy.log you will
# need