关闭

私有云落地解决方案之openstack高可用(pike版本)-haproxy

标签: openstack解决方案私有云高可用ha
256人阅读 评论(0) 收藏 举报
分类:

作者:【吴业亮】

博客:http://blog.csdn.net/wylfengyujiancheng

1、三个节点安装haproxy,并设置开机自动启动

#  yum install -y haproxy
#  systemctl enable haproxy

2、跟rsyslog结合配置haproxy日志,在三个节点上都操作
配置/etc/rsyslog.d/haproxy.conf

$ModLoad imudp
$UDPServerRun 514
$template Haproxy,"%rawmsg% \n"
local0.=info -/var/log/haproxy.log;Haproxy
local.notice -/var/log/haproxy-status.log;Haproxy
local.* ~
# systemctl restart rsyslog.service
# systemctl status rsyslog.service

3、在三个节点上配置haproxy.cfg文件

global
    log             127.0.0.1 local3
    chroot          /var/lib/haproxy
    pidfile         /var/run/haproxy.pid
    stats  socket     /var/lib/haproxy/stats
    maxconn         40000
    user            haproxy
    group           haproxy
    daemon
    spread-checks      3
    tune.bufsize      32768
    tune.maxrewrite 1024
    tune.ssl.default-dh-param  2048

defaults
    mode    http
    log     global
    option  httplog
    option  tcplog
    option  redispatch
    option  http-server-close
    option  splice-auto
    option  dontlognull
    retries 3
    timeout http-request 20s
    timeout queue 1m
    timeout connect 10s
    timeout client 1m
    timeout server 1m
    timeout check 10s
    maxconn 8000

listen stats
    bind 0.0.0.0:8888
    mode http
    stats enable
    stats uri /
    stats realm Haproxy\ Statistics
    stats auth admin:Changeme_123
    stats  refresh 5s
    stats  show-node
    stats  show-legends
    stats  hide-version

listen db-cloud
    bind 172.16.8.50:3306
    balance  source
    hash-type consistent
    mode       tcp
    option  tcplog
    option  clitcpka
    option  srvtcpka
    option  httpchk
    timeout client  28801s
    timeout server  28801s
            server node1 172.16.8.60:3306 check port 9200 inter 20s fastinter 2s downinter 2s rise 3 fall 3
            server node2 172.16.8.61:3306 check port 9200 inter 20s fastinter 2s downinter 2s rise 3 fall 3 backup
            server node3 172.16.8.62:3306 check port 9200 inter 20s fastinter 2s downinter 2s rise 3 fall 3 backup

listen mq-cloud
    bind 172.16.8.50:5672 tcp-ut 5s
    mode tcp
    option tcpka
    balance roundrobin
            server node1 172.16.8.60:5672 check inter 10s fastinter 2s downinter 2s rise 3 fall 3
            server node2 172.16.8.61:5672 check inter 10s fastinter 2s downinter 2s rise 3 fall 3
            server node3 172.16.8.62:5672 check inter 10s fastinter 2s downinter 2s rise 3 fall 3

listen keystone-admin-cloud
    bind 172.16.8.50:35357
    http-request  set-header X-Forwarded-Proto https if { ssl_fc }
    option  httplog
    option  httpclose
    option  forwardfor
            server node1 172.16.8.60:35357 check inter 10s fastinter 2s downinter 2s rise 3 fall 3
            server node2 172.16.8.61:35357 check inter 10s fastinter 2s downinter 2s rise 3 fall 3
            server node3 172.16.8.62:35357 check inter 10s fastinter 2s downinter 2s rise 3 fall 3

listen keystone-cloud
    bind 172.16.8.50:5000
    http-request  set-header X-Forwarded-Proto https if { ssl_fc }
    option  httplog
    option  httpclose
    option  forwardfor
            server node1 172.16.8.60:5000 check inter 10s fastinter 2s downinter 2s rise 3 fall 3
            server node2 172.16.8.61:5000 check inter 10s fastinter 2s downinter 2s rise 3 fall 3
            server node3 172.16.8.62:5000 check inter 10s fastinter 2s downinter 2s rise 3 fall 3

listen glance-registry-cloud
    bind 172.16.8.50:9191
    timeout server          30m
            server node1 172.16.8.60:9191 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
            server node2 172.16.8.61:9191 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
            server node3 172.16.8.62:9191 check inter 10s fastinter 2s downinter 3s rise 3 fall 3

listen glance-api-cloud
    bind 172.16.8.50:9292
    http-request  set-header X-Forwarded-Proto https if { ssl_fc }
    option  httpchk /versions
    option  httplog
    option  httpclose
    timeout server  30m
            server node1 172.16.8.60:9292 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
            server node2 172.16.8.61:9292 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
            server node3 172.16.8.62:9292 check inter 10s fastinter 2s downinter 3s rise 3 fall 3

listen nova-api-cloud
    bind 172.16.8.50:8774
    http-request  set-header X-Forwarded-Proto https if { ssl_fc }
    option  httpchk
    option  httplog
    option  httpclose
    timeout server  600s
            server node1 172.16.8.60:8774 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
            server node2 172.16.8.61:8774 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
            server node3 172.16.8.62:8774 check inter 10s fastinter 2s downinter 3s rise 3 fall 3

listen nova-metadata-api-cloud
    bind 172.16.8.50:8775
    option  httpchk
    option  httplog
    option  httpclose
            server node1 172.16.8.60:8775 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
            server node2 172.16.8.61:8775 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
            server node3 172.16.8.62:8775 check inter 10s fastinter 2s downinter 3s rise 3 fall 3

listen vnc-cloud
    bind 172.16.8.50:6080
    http-request set-header X-Forwarded-Proto https if { ssl_fc }
            server node1 172.16.8.60:6080 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
            server node2 172.16.8.61:6080 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
            server node3 172.16.8.62:6080 check inter 10s fastinter 2s downinter 3s rise 3 fall 3


listen nova-placement-api-cloud
    bind 172.16.8.50:8778
    http-request set-header X-Forwarded-Proto https if { ssl_fc }
            server node1 172.16.8.60:8778 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
            server node2 172.16.8.61:8778 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
            server node3 172.16.8.62:8778 check inter 10s fastinter 2s downinter 3s rise 3 fall 3

listen neutron-api-cloud
    bind 172.16.8.50:9696
    http-request set-header X-Forwarded-Proto https if { ssl_fc }
    option  httpchk
    option  httplog
    option  httpclose
            server node1 172.16.8.60:9696 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
            server node2 172.16.8.61:9696 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
            server node3 172.16.8.62:9696 check inter 10s fastinter 2s downinter 3s rise 3 fall 3

listen dashboard_cloud
    bind 172.16.8.50:80
    balance  source
    option  tcpka
    option  httpchk
    option  tcplog
    server node1 172.16.8.60:80 check inter 2000 rise 2 fall 5
    server node3 172.16.8.61:80 check inter 2000 rise 2 fall 5
    server node3 172.16.8.62:80 check inter 2000 rise 2 fall 5

listen cinder-api-cloud
    bind 172.16.8.50:8776
    http-request set-header X-Forwarded-Proto https if { ssl_fc }
    option  httpchk
    option  httplog
    option  httpclose
            server node1 172.16.8.60:8776 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
            server node2 172.16.8.61:8776 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
            server node3 172.16.8.62:8776 check inter 10s fastinter 2s downinter 3s rise 3 fall 3

4、修改三个节点的内核参数使haproxy正常启动

# echo "net.ipv4.ip_nonlocal_bind = 1" >>/etc/sysctl.conf
# echo "net.ipv4.ip_forward = 1" >>/etc/sysctl.conf
# sysctl -p 

5、三个节点启动haproxy服务

# systemctl restart haproxy
# systemctl status haproxy

6、访问haproxy前端web界面
http://172.16.8.60:8888/

admin/Changeme_123

0
0
查看评论
发表评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场

基于openstack构建私有云实践

主要分享的是云计算、openstack的使用、私有云平台建设、云服务器云硬盘的构建和使用。从基本概念入手到私有云建设,信息量非常大。对于openstack的安装部署都是从官方文档中一步步的介绍,内容非...
  • sdksdk0
  • sdksdk0
  • 2017-02-02 13:35
  • 2743

mitaka版本openstack虚拟化云桌面的实现(spice)

作者:【吴业亮】云计算开发工程师 博客:http://blog.csdn.net/wylfengyujiancheng 什么是vdi VDI,英文全称Virtual Desktop Infrast...
  • wylfengyujiancheng
  • wylfengyujiancheng
  • 2016-07-05 23:13
  • 7273

运维笔记33 (haproxy的配置,pacemaker高可用+haproxy)

概述:之前的博客中提到的一种负载均衡方式是lvs,lvs的配置简单,减少了认为出错的概率,而且软件处在tcp/ip协议栈的第四层,可以对各种web应用服务,但是因为本身不支持正则表达式处理,不能做动静...
  • No_red
  • No_red
  • 2017-03-18 23:46
  • 1322

私有云落地解决方案之openstack高可用(pike版本)-架构

作者:【吴业亮】博客:http://blog.csdn.net/wylfengyujiancheng本架构借鉴redhat架构1、API 服务:包括 *-api, neutron-server,gla...
  • wylfengyujiancheng
  • wylfengyujiancheng
  • 2017-11-27 22:15
  • 358

私有云落地解决方案之openstack高可用(pike版本)-neutron【ovs】

作者:【吴业亮】博客:http://blog.csdn.net/wylfengyujiancheng创建用户# openstack user create --domain default --pro...
  • wylfengyujiancheng
  • wylfengyujiancheng
  • 2017-11-27 22:46
  • 286

私有云落地解决方案之openstack高可用(pike版本)-数据库

作者:【吴业亮】博客:http://blog.csdn.net/wylfengyujiancheng1、安装rpm包# yum install -y MariaDB-server MariaDB-c...
  • wylfengyujiancheng
  • wylfengyujiancheng
  • 2017-11-27 22:26
  • 261

私有云落地解决方案之openstack高可用(pike版本)-cinder

作者:【吴业亮】博客:http://blog.csdn.net/wylfengyujiancheng创建用户# openstack user create --domain default --pro...
  • wylfengyujiancheng
  • wylfengyujiancheng
  • 2017-11-28 09:23
  • 207

私有云落地解决方案之openstack高可用(pike版本)-集群参数

作者:【吴业亮】博客:http://blog.csdn.net/wylfengyujiancheng一、添加服务将消息队列加入集群监控中crm configure primitive rabbitmq...
  • wylfengyujiancheng
  • wylfengyujiancheng
  • 2017-11-28 10:29
  • 506

私有云落地解决方案之openstack高可用(pike版本)-添加计算节点

作者:【吴业亮】博客:http://blog.csdn.net/wylfengyujianchengNova 安装软件包# yum install openstack-nova-compute ...
  • wylfengyujiancheng
  • wylfengyujiancheng
  • 2017-11-28 09:34
  • 233

私有云落地解决方案之openstack高可用(pike版本)-nova

作者:【吴业亮】博客:http://blog.csdn.net/wylfengyujiancheng控制节点安装 创建数据库ova_api, nova, and nova_cell0 databas...
  • wylfengyujiancheng
  • wylfengyujiancheng
  • 2017-11-27 22:44
  • 296
    个人资料
    • 访问:378025次
    • 积分:4200
    • 等级:
    • 排名:第8416名
    • 原创:141篇
    • 转载:0篇
    • 译文:0篇
    • 评论:65条
    文章分类
    最新评论