Openstack 集群,及常用服务的 高可用 haproxy配置
一、介绍
配置文件位置(yum 安装):/etc/haproxy/haproxy.cfg
全局配置
#---------------------------------------------------------------------
# Global settings
#---------------------------------------------------------------------
global
log 127.0.0.1 local2 chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 4000
user haproxy
group haproxy
daemon
stats socket /var/lib/haproxy/stats
默认配置
#---------------------------------------------------------------------
# common defaults that all the 'listen' and 'backend' sections will
# use if not designated in their block
#---------------------------------------------------------------------
defaults
mode http
log global
option httplog
option dontlognull
option forwardfor
option redispatch
retries 3
timeout http-request 10s
timeout queue 1m
timeout connect 10s
timeout client 1m
timeout server 1m
timeout http-keep-alive 10s
timeout check 10s
maxconn 3000
配置haproxy 的统计页面
#---------------------------------------------------------------------
# tong ji ye mian pei zhi
#---------------------------------------------------------------------
listen stats
bind 10.6.32.200:1080
mode http
option httplog
log 127.0.0.1 local0 err
stats refresh 30s
maxconn 10
stats uri /admin
stats realm Haproxy\ Statistics
stats auth admin:admin #web登录的账号密码
stats hide-version
stats admin if TRUE
在浏览器中访问:http://10.6.32.200:1080/admin
1、httpd 服务
#---------------------------------------------------------------------
# listen httpd server
#---------------------------------------------------------------------
listen httpd_cluster
bind 10.6.32.200:
balance roundrobin
option tcpka
option httpchk
option tcplog
server controller1 controller1: check port inter rise fall
server controller2 controller2: check port inter rise fall
server controller3 controller3: check port inter rise fall
2、mysql 服务
#---------------------------------------------------------------------
# listen Mysql-db server
#---------------------------------------------------------------------
listen mysql_cluster
mode tcp
bind 10.6.32.200:
balance source
option mysql-check user haproxy # 需要在数据库中创建没有密码的 haproxy用户,不需要有任何权限,详情查看博客:Mysql 5.7 弱密码限制,及创建用户无密码用户
server controller1 controller1: weight check inter rise fall
server controller2 controller2: weight check inter rise fall
server controller3 controller3: weight check inter rise fall
3、 keystone-admin API
#---------------------------------------------------------------------
# listen keystone-admin server
#---------------------------------------------------------------------
listen keystone_admin
bind 10.6.32.200:35357
balance source
option tcpka
option httpchk
option tcplog
http-request del-header X-Forwarded-Proto if { ssl_fc }
server controller1 10.6.32.51:35357 check inter 2000 rise 2 fall 5
server controller2 10.6.32.52:35357 check inter 2000 rise 2 fall 5
server controller3 10.6.32.53:35357 check inter 2000 rise 2 fall 5
4、keystone-public 和 keystone-internal API
#---------------------------------------------------------------------
# listen keystone-public and keystone-internal server
#---------------------------------------------------------------------
listen keystone_pub_int
bind 10.6.32.200:5000 #需要将haproxy 默认自带的 frontend main *:5000 区块注释掉,有端口冲突
balance source
option tcpka
option httpchk
option tcplog
http-request del-header X-Forwarded-Proto if { ssl_fc }
server controller1 controller1:5000 check inter 2000 rise 2 fall 5
server controller2 controller2:5000 check inter 2000 rise 2 fall 5
server controller3 controller3:5000 check inter 2000 rise 2 fall 5
5、Glance-api server
#---------------------------------------------------------------------
# listen glance-admin,glance-public,glance-internal server
#---------------------------------------------------------------------
listen glance-api
bind 10.6.32.200:9292
balance source
option tcpka
option httpchk
option tcplog
server controller1 10.6.32.51:9292 check inter 2000 rise 2 fall 5
server controller2 10.6.32.52:9292 check inter 2000 rise 2 fall 5
server controller3 10.6.32.53:9292 check inter 2000 rise 2 fall 5
6、Glance-registery server
#---------------------------------------------------------------------
# listen glance-registery server
#---------------------------------------------------------------------
listen glance-registery
bind 10.6.32.200:9191
balance source
option tcpka
option tcplog
server controller1 10.6.32.51:9191 check inter 2000 rise 2 fall 5
server controller2 10.6.32.52:9191 check inter 2000 rise 2 fall 5
server controller3 10.6.32.53:9191 check inter 2000 rise 2 fall 5
7、rabbitmq-web
#---------------------------------------------------------------------
# listen Rabbitmq-web server
#---------------------------------------------------------------------
listen rabbitmq-web
mode tcp
bind 10.6.32.200:15671
balance roundrobin
server controller1 10.6.32.51:15672 check inter 2000 rise 2 fall 5
server controller2 10.6.32.52:15672 check inter 2000 rise 2 fall 5
server controller3 10.6.32.53:15672 check inter 2000 rise 2 fall 5
8、nova-api server
#---------------------------------------------------------------------
# listen nova-api server
#---------------------------------------------------------------------
listen nova-api
bind 10.6.32.200:8774
balance source
option tcpka
option httpchk
option tcplog
http-request del-header X-Forwarded-Proto if { ssl_fc }
server controller1 controller1:8774 check inter 2000 rise 2 fall 5
server controller2 controller2:8774 check inter 2000 rise 2 fall 5
server controller3 controller3:8774 check inter 2000 rise 2 fall 5
9、nova novncproxy server
#---------------------------------------------------------------------
# listen nova-novncproxy server
#---------------------------------------------------------------------
listen nova_novncproxy
bind 10.6.32.200:6080
balance source
option tcpka
option tcplog
http-request del-header X-Forwarded-Proto if { ssl_fc }
http-request set-header X-Forwarded-Proto https if { ssl_fc }
server controller1 controller1:6080 check inter 2000 rise 2 fall 5
server controller2 controller2:6080 check inter 2000 rise 2 fall 5
server controller3 controller3:6080 check inter 2000 rise 2 fall 5
10、nova-placement-api server
#---------------------------------------------------------------------
# listen nova-placement public、internal、admin server
#---------------------------------------------------------------------
listen nova_placement-api
bind 10.6.32.200:8778
balance source
option tcpka
option tcplog
http-request del-header X-Forwarded-Proto if { ssl_fc }
server controller1 controller1:8778 check inter 2000 rise 2 fall 5
server controller2 controller2:8778 check inter 2000 rise 2 fall 5
server controller3 controller3:8778 check inter 2000 rise 2 fall 5
11、neutron server
#---------------------------------------------------------------------
# listen neutron server
#---------------------------------------------------------------------
listen neutron
bind 10.6.32.200:9696
balance source
option tcpka
option tcplog
server controller1 controller1:9696 check inter 2000 rise 2 fall 5
server controller2 controller2:9696 check inter 2000 rise 2 fall 5
server controller3 controller3:9696 check inter 2000 rise 2 fall 5
12、 memcache server
#---------------------------------------------------------------------
# listen memcached server
#---------------------------------------------------------------------
listen memcache
mode tcp
bind 10.6.32.200:11211
balance static-rr
server controller1 controller1:11211 weight 1 check inter 2000 rise 2 fall 5
server controller2 controller2:11211 weight 10 check inter 2000 rise 2 fall 5
server controller3 controller3:11211 weight 20 check inter 2000 rise 2 fall 5
13、cinder server
#---------------------------------------------------------------------
# listen cinder_api server
#---------------------------------------------------------------------
listen cinder_api
bind 10.6.32.200:8776
balance source
option tcpka
option tcplog
http-request del-header X-Forwarded-Proto if { ssl_fc }
server controller1 controller1:8776 check inter 2000 rise 2 fall 5
server controller2 controller2:8776 check inter 2000 rise 2 fall 5
server controller3 controller3:8776 check inter 2000 rise 2 fall 5
Openstack 集群,及常用服务的 高可用 haproxy配置的更多相关文章
- openstack高可用haproxy配置
#openstack高可用haproxy配置openstack pike 部署 目录汇总 http://www.cnblogs.com/elvi/p/7613861.html #openstack高可 ...
- 企业运维实践-还不会部署高可用的kubernetes集群?使用kubeadm方式安装高可用k8s集群v1.23.7
关注「WeiyiGeek」公众号 设为「特别关注」每天带你玩转网络安全运维.应用开发.物联网IOT学习! 希望各位看友[关注.点赞.评论.收藏.投币],助力每一个梦想. 文章目录: 0x00 前言简述 ...
- 15套java互联网架构师、高并发、集群、负载均衡、高可用、数据库设计、缓存、性能优化、大型分布式 项目实战视频教程
* { font-family: "Microsoft YaHei" !important } h1 { color: #FF0 } 15套java架构师.集群.高可用.高可扩 展 ...
- openstack集群访问外部服务出现访问失败
场景描述: openstack私有云中的容器服务A(部署在openshift上)需要通过http访问阿里云中的B服务,中间需要经过openstack的nat网关,以及阿里云的lb.但在访问时发现访问失 ...
- Linux下"负载均衡+高可用"集群的考虑点 以及 高可用方案说明(Keepalive/Heartbeat)
当下Linux运维技术越来越受到企业的关注和追捧, 在某些企业, 尤其是牵涉到电子商务和电子广告类的网站,通常会要求作负载均衡和高可用的Linux集群方案.那么如何实施Llinux集群架构,才能既有效 ...
- Java集群优化——dubbo+zookeeper构建高可用分布式集群
不久前,我们讨论过Nginx+tomcat组成的集群,这已经是非常灵活的集群技术,但是当我们的系统遇到更大的瓶颈,全部应用的单点服务器已经不能满足我们的需求,这时,我们要考虑另外一种,我们熟悉的内容, ...
- 基于zookeeper(集群)+LevelDB的ActiveMq高可用集群安装、配置、测试
一. zookeeper安装(集群):http://www.cnblogs.com/wangfajun/p/8692117.html √ 二. ActiveMq配置: 1. ActiveMq集群部署 ...
- Redis Cluster 集群三主三从高可用环境搭建
前言 Redis 是我们目前大规模使用的缓存中间件,由于它强大高效而又便捷的功能,得到了广泛的使用. Window环境下载地址:https://github.com/tporadowski/redis ...
- centos7下用kubeadm安装k8s集群并使用ipvs做高可用方案
1.准备 1.1系统配置 在安装之前,需要先做如下准备.三台CentOS主机如下: 配置yum源(使用腾讯云的) 替换之前先备份旧配置 mv /etc/yum.repos.d/CentOS-Base. ...
随机推荐
- Appium——主从控制执行
1.客户端(Eclipse)机器A, 服务端(appium.Genymotion)机器B 2.设置Appium,Server Address为192.168.17.123,重新启动Appium 3.在 ...
- mezzanine的page表
class Orderable(with_metaclass(OrderableBase, models.Model)): """ Abstract model that ...
- kubernetes安装过程报错及解决方法
1.your configuration file uses an old API spec: "kubeadm.k8s.io/v1alpha2". 执行kubeadm init ...
- filter map reduce函数的使用
#filter("处理逻辑","可迭代对象") 把可迭代对象依次处理逻辑处理,如果值为真就返回值,值为假就不返回; li = ['testA','yerA',' ...
- C# 类库调试 启动外部程序无法调试
无法调试进程 test.exe [17936] 中的某些代码.请参阅下面的状态信息. IntelliTrace 代码失败(0x80131534). Managed (v4.6.v4.5.v4.0 ...
- js删除dom节点时候索引出错问题
我们知道删除一个dom节点的时候索引就会发生了改变,甚至是错误,就算jq的ecah也无能为力,所以我们只能自己写个功能了 直接上代码把,不多说 <!DOCTYPE html> <ht ...
- span标签 宽度无效解决方案
完美的解决方案 下 面代码的CSS定义完美解决了span的宽度设置问题. 由于浏览器通常对不支持的CSS属性采取忽略处理的态度, 所以最好将display:inline -block行写在后面,这样在 ...
- TCP连接异常断开检测(转)
TCP是一种面向连接的协议,连接的建立和断开需要通过收发相应的分节来实现.某些时候,由于网络的故障或是一方主机的突然崩溃而另一方无法检测到,以致始终保持着不存在的连接.下面介绍一种方法来检测这种异常断 ...
- C#可变参数params
using System.Collections; using System.Collections.Generic; using UnityEngine; public class TestPara ...
- react native 中es6语法解析
react native是直接使用es6来编写代码,许多新语法能提高我们的工作效率 解构赋值 var { StyleSheet, Text, View } = React; 这句代码是ES6 中新增的 ...