openstack部署脚本

链接:<https://pan.baidu.com/s/1BTp_tGNC6ZWwVmKkhwivgw >

提取码:jxuz


haproxy 官网:< https://www.haproxy.org/ >

haproxy推荐阅读:http://www.ttlsa.com/linux/haproxy-study-tutorial/


openstack部署haproxy

在所有节点安装Haproxy

第一步:安装haproxy

  1. yum -y install haproxy
  2. systemctl enable haproxy.service

第二步:所有节点配置haproxy

  1. cat <<EOF>/etc/rsyslog.d/haproxy.conf
  2. $ModLoad imudp
  3. $UDPServerRun 514
  4. $template Haproxy,"%msg%n"
  5. local0.=info -/var/log/haproxy.log;Haproxy
  6. local0.notice -/var/log/haproxy-status.log;Haproxy
  7. local0.* ~
  8. EOF
  9. systemctl restart rsyslog.service
  10. systemctl status rsyslog.service
  11. cat <<EOF>/etc/haproxy/haproxy.cfg
  12. global
  13. log 127.0.0.1 local3
  14. chroot /var/lib/haproxy
  15. pidfile /var/run/haproxy.pid
  16. stats socket /var/lib/haproxy/stats
  17. maxconn 40000
  18. user haproxy
  19. group haproxy
  20. daemon
  21. spread-checks 3
  22. tune.bufsize 32768
  23. tune.maxrewrite 1024
  24. tune.ssl.default-dh-param 2048
  25. defaults
  26. mode http
  27. log global
  28. option httplog
  29. option tcplog
  30. option redispatch
  31. option http-server-close
  32. option splice-auto
  33. option dontlognull
  34. retries 3
  35. timeout http-request 20s
  36. timeout queue 1m
  37. timeout connect 10s
  38. timeout client 1m
  39. timeout server 1m
  40. timeout check 10s
  41. maxconn 8000
  42. listen stats
  43. bind 0.0.0.0:8789
  44. mode http
  45. stats enable
  46. stats uri /
  47. stats realm Haproxy\ Statistics
  48. stats auth admin:admin
  49. stats refresh 15s
  50. stats show-node
  51. stats show-legends
  52. stats hide-version
  53. listen dashboard_cluster
  54. bind 192.168.210.120:8080
  55. balance source
  56. option tcpka
  57. option httpchk
  58. option tcplog
  59. server node1 192.168.210.131:80 check inter 2000 rise 2 fall 5
  60. server node2 192.168.210.130:80 check inter 2000 rise 2 fall 5
  61. server node3 192.168.210.132:80 check inter 2000 rise 2 fall 5
  62. listen galera_cluster
  63. bind 192.168.210.120:3307
  64. balance source
  65. hash-type consistent
  66. mode tcp
  67. option tcplog
  68. option clitcpka
  69. option srvtcpka
  70. option httpchk
  71. timeout client 28801s
  72. timeout server 28801s
  73. server node1 192.168.210.131:3306 check port 9200 inter 20s fastinter 2s downinter 2s rise 3 fall 3
  74. server node2 192.168.210.130:3306 check port 9200 inter 20s fastinter 2s downinter 2s rise 3 fall 3 backup
  75. server node3 192.168.210.132:3306 check port 9200 inter 20s fastinter 2s downinter 2s rise 3 fall 3 backup
  76. listen mq_cluster
  77. bind 192.168.210.120:5672 tcp-ut 5s
  78. mode tcp
  79. option tcpka
  80. balance roundrobin
  81. server node1 192.168.210.131:5672 check inter 10s fastinter 2s downinter 2s rise 3 fall 3
  82. server node2 192.168.210.130:5672 check inter 10s fastinter 2s downinter 2s rise 3 fall 3
  83. server node3 192.168.210.132:5672 check inter 10s fastinter 2s downinter 2s rise 3 fall 3
  84. listen keystone_admin_cluster
  85. bind 192.168.210.120:35358
  86. http-request set-header X-Forwarded-Proto https if { ssl_fc }
  87. option httplog
  88. option httpclose
  89. option forwardfor
  90. server node1 192.168.210.131:35357 check inter 10s fastinter 2s downinter 2s rise 3 fall 3
  91. server node2 192.168.210.130:35357 check inter 10s fastinter 2s downinter 2s rise 3 fall 3
  92. server node3 192.168.210.132:35357 check inter 10s fastinter 2s downinter 2s rise 3 fall 3
  93. listen keystone_public_internal_cluster
  94. bind 192.168.210.120:5001
  95. http-request set-header X-Forwarded-Proto https if { ssl_fc }
  96. option httplog
  97. option httpclose
  98. option forwardfor
  99. server node1 192.168.210.131:5000 check inter 10s fastinter 2s downinter 2s rise 3 fall 3
  100. server node2 192.168.210.130:5000 check inter 10s fastinter 2s downinter 2s rise 3 fall 3
  101. server node3 192.168.210.132:5000 check inter 10s fastinter 2s downinter 2s rise 3 fall 3
  102. listen glance_registry_cluster
  103. bind 192.168.210.120:9192
  104. timeout server 30m
  105. server node1 192.168.210.131:9191 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
  106. server node2 192.168.210.130:9191 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
  107. server node3 192.168.210.132:9191 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
  108. listen glance_api_cluster
  109. bind 192.168.210.120:9293
  110. http-request set-header X-Forwarded-Proto https if { ssl_fc }
  111. option httpchk /versions
  112. option httplog
  113. option httpclose
  114. timeout server 30m
  115. server node1 192.168.210.131:9292 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
  116. server node2 192.168.210.130:9292 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
  117. server node3 192.168.210.132:9292 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
  118. listen nova_ec2_api_cluster
  119. bind 192.168.210.120:9774
  120. http-request set-header X-Forwarded-Proto https if { ssl_fc }
  121. option httpchk
  122. option httplog
  123. option httpclose
  124. timeout server 600s
  125. server node1 192.168.210.131:8774 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
  126. server node2 192.168.210.130:8774 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
  127. server node3 192.168.210.132:8774 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
  128. listen nova_compute_api_cluster
  129. bind 192.168.210.120:9773
  130. http-request set-header X-Forwarded-Proto https if { ssl_fc }
  131. option httpchk
  132. option httplog
  133. option httpclose
  134. server node1 192.168.210.131:8773 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
  135. server node2 192.168.210.131:8773 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
  136. server node3 192.168.210.131:8773 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
  137. listen nova_metadata_api_cluster
  138. bind 192.168.210.120:9775
  139. option httpchk
  140. option httplog
  141. option httpclose
  142. server node1 192.168.210.131:8775 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
  143. server node2 192.168.210.130:8775 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
  144. server node3 192.168.210.132:8775 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
  145. listen nova_vncproxy_cluster
  146. bind 192.168.210.120:6081
  147. http-request set-header X-Forwarded-Proto https if { ssl_fc }
  148. server node1 192.168.210.131:6080 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
  149. server node2 192.168.210.130:6080 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
  150. server node3 192.168.210.132:6080 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
  151. listen nova_placement_cluster
  152. bind 192.168.210.120:9778
  153. http-request set-header X-Forwarded-Proto https if { ssl_fc }
  154. server node1 192.168.210.131:8778 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
  155. server node2 192.168.210.130:8778 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
  156. server node3 192.168.210.132:8778 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
  157. listen neutron_api_cluster
  158. bind 192.168.210.120:9697
  159. http-request set-header X-Forwarded-Proto https if { ssl_fc }
  160. option httpchk
  161. option httplog
  162. option httpclose
  163. server node1 192.168.210.131:9696 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
  164. server node2 192.168.210.130:9696 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
  165. server node3 192.168.210.132:9696 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
  166. listen cinder_api_cluster
  167. bind 192.168.210.120:9776
  168. http-request set-header X-Forwarded-Proto https if { ssl_fc }
  169. option httpchk
  170. option httplog
  171. option httpclose
  172. server node1 192.168.210.131:8776 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
  173. server node2 192.168.210.130:8776 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
  174. server node3 192.168.210.132:8776 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
  175. listen ceilometer_api_cluster
  176. bind 192.168.210.120:9777
  177. http-request set-header X-Forwarded-Proto https if { ssl_fc }
  178. option httplog
  179. option httpclose
  180. server node1 192.168.210.131:8777 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
  181. server node2 192.168.210.130:8777 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
  182. server node3 192.168.210.132:8777 check inter 10s fastinter 2s downinter 3s rise 3 fall 3
  183. EOF

OpenStack (haproxy)的更多相关文章

  1. 学习openstack(六)

    VIII openstack(1) 传统的数据中心面临的问题:成本.效率(要快).管理方面(物理机.云主机): 云计算:对运维需求总体量是减少了,尤其是硬件工程师,对运维的技术要求提高了: 云计算是个 ...

  2. OpenStack(三)——allinone云平台的使用方法

    接着OpenStack(二)——使用Kolla部署OpenStack-allinone云平台继续操作. 特别感谢https://www.cnblogs.com/openstackteam/p/5519 ...

  3. 理解 Neutorn LBaaS - 每天5分钟玩转 OpenStack(120)

    Load Balance as a Service(LBaaS)是 Neutron 提供的一项高级网络服务.LBaaS 允许租户在自己的网络中创建和管理 load balancer. load bal ...

  4. Neutron 功能概述 - 每天5分钟玩转 OpenStack(65)

    从今天开始,我们将学习 OpenStack 的 Networking Service,Neutron.Neutron 的难度会比前面所有模块都大一些,内容也多一些.为了帮助大家更好的掌握 Neutor ...

  5. OpenStack(四)——使用Kolla部署OpenStack多节点云

    (1).实验环境 主机名 IP地址 角色 内存 网卡 CPU 磁盘 OpenStack-con 192.168.128.110 controller(控制) 8G 桥接网卡ens32和ens33 4核 ...

  6. 学习openstack(八)

      一.OpenStack初探 1.1 OpenStack简介 OpenStack是一整套开源软件项目的综合,它允许企业或服务提供者建立.运行自己的云计算和存储设施.Rackspace与NASA是最初 ...

  7. 学习openstack(五)

    OpenStackOpenStack介绍OpenStack是一种免费的开源平台,帮助服务提供商实现类似于亚马逊EC2和S3的基础设施服务.OpenStack当前有三个核心项目:计算(Nova),对象存 ...

  8. 学习openstack(四)

    一.KVM虚拟化 1.KVM的安装: yum install qemu-kvm qemu-kvm-tools virt-manager libvirt virt-install /etc/init.d ...

  9. 学习openstack(三)

      一.OpenStack初探 1.1 OpenStack简介 OpenStack是一整套开源软件项目的综合,它允许企业或服务提供者建立.运行自己的云计算和存储设施.Rackspace与NASA是最初 ...

随机推荐

  1. C语言3中循环语句的比较

    (1)while和do-while循环只在while后面指定条件,在循环体中应包含使循环趋于结束的语句如(I++):for循环可以在表达式三中包含使循环趋于结束的操作,可以设置循环体中的操作全部放在语 ...

  2. Spring Boot 2.0 的配置绑定类Bindable居然如此强大

    1. 前言 在开发Spring Boot应用时会用到根据条件来向Spring IoC容器注入Bean.比如配置文件存在了某个配置属性才注入Bean : 图中红色的部分是说,只有ali.pay.v1.a ...

  3. Spring Boot Security 国际化 多语言 i18n 趟过巨坑

    网上很多的spring boot国际化的文章都是正常情况下的使用方法 如果你像我一样用了Spring Security 那么在多语言的时候可能就会遇到一个深渊 Spring Security里面的异常 ...

  4. 【Redis3.0.x】事务

    Redis3.0.x 事务 基本概念 multi,exec,discard,watch 是 Redis 事务的基础,它们允许一步执行一组命令,有两个重要保证: 事务中的所有命令都被序列化并顺序执行.在 ...

  5. Linux调整lvm逻辑分区大小

    转载自:https://www.cnblogs.com/kevingrace/p/5825963.html  个人记录一下   Linux下对lvm逻辑卷分区大小的调整(针对xfs和ext4不同文件系 ...

  6. docker save 保存导出镜像

    Docker保存镜像 tag 镜像 # 镜像打 tag 标签 # docker tag 镜像id/名 新名字 docker tag fce91102e17d tomcat01 commit 镜像 注意 ...

  7. 【LeetCode】数组排序题 Array_Sorts

    数组排序 Array_Sorts LeetCode 数组排序题 88. 合并两个有序数组 合并两个有序数组 难度简单 给你两个有序整数数组 nums1 和 nums2,请你将 nums2 合并到 nu ...

  8. 【Git】2、Linux快速安装Git环境 & oh-my-zsh

    Linux快速安装Git环境 文章目录 Linux快速安装Git环境 1.Linux安装Git 2.安装zsh 3.安装oh-my-zsh 3.1.安装oh-my-zsh 3.2. 测试验证 4.小结 ...

  9. 【Oracle】regexp_substr()函数详解

    环境:Oracle10.2.0.5 在SQL中尝试使用正则 可以试下regexp_substr()来进行分割 首先创建一个实验视图: SQL> create or replace view te ...

  10. 3A限流IC,带短路保护,PW1503和PW1502

    一般说明 PW1503,PW1502是超低RDS(ON)开关,具有可编程的电流限制,以保护电源源于过电流和短路保护.它具有超温保护以及反向闭锁功能. PW1503,PW1502采用薄型(1毫米)5针薄 ...