其他优化补充说明
哪些组件一般不通过haproxy做负载?
Memcached一般使用Openstack自带的集群管理方案,而不是加入haproxy。
1 |
memcached_servers = controller01:11211,controller2:11211,controller3:11211 |
RabbitMQ用haproxy负载还是用openstack自带的集群管理方案?
Openstack官方建议使用其自带的集群管理方案,但本人一直通过haproxy进行负载,暂未发现问题。
1 2 |
transport_url=rabbit://openstack:Openstack123@10.10.100.98:5672 #transport_url=rabbit://openstack:Openstack123@controller1:5672,controller2:5672,controller3:5672 |
适用于openstack集群的haproxy的全部配置如下,具体参数可以根据实际情况进行调整:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 |
global log 127.0.0.1 local2 chroot /var/lib/haproxy pidfile /var/run/haproxy.pid maxconn 51200 user haproxy group haproxy daemon spread-checks 3 tune.bufsize 32768 tune.maxrewrite 1024 tune.ssl.default-dh-param 2048 stats socket /var/lib/haproxy/stats defaults mode http log global option httplog option dontlognull option http-server-close option forwardfor except 127.0.0.0/8 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 listen cinder_api bind 10.10.100.93:8776 option tcpka option httpchk option tcplog balance source server controller1 10.10.100.150:8776 check inter 5s fastinter 1s downinter 2s rise 3 fall 3 server controller2 10.10.100.149:8776 check inter 5s fastinter 1s downinter 2s rise 3 fall 3 server controller3 10.10.100.148:8776 check inter 5s fastinter 1s downinter 2s rise 3 fall 3 listen nova_api bind 10.10.100.94:8773 option tcpka option tcplog balance source server controller1 10.10.100.150:8773 check inter 5s fastinter 1s downinter 2s rise 3 fall 3 server controller2 10.10.100.149:8773 check inter 5s fastinter 1s downinter 2s rise 3 fall 3 server controller3 10.10.100.148:8773 check inter 5s fastinter 1s downinter 2s rise 3 fall 3 listen nova_compute_api bind 10.10.100.94:8774 option tcpka option httpchk option tcplog balance source server controller1 10.10.100.150:8774 check inter 5s fastinter 1s downinter 2s rise 3 fall 3 server controller2 10.10.100.149:8774 check inter 5s fastinter 1s downinter 2s rise 3 fall 3 server controller3 10.10.100.148:8774 check inter 5s fastinter 1s downinter 2s rise 3 fall 3 listen nova_placement bind 10.10.100.94:8778 option tcpka option tcplog balance source server controller1 10.10.100.150:8778 check inter 5s fastinter 1s downinter 2s rise 3 fall 3 server controller2 10.10.100.149:8778 check inter 5s fastinter 1s downinter 2s rise 3 fall 3 server controller3 10.10.100.148:8778 check inter 5s fastinter 1s downinter 2s rise 3 fall 3 listen nova_vncproxy bind 10.10.100.94:6080 option tcpka option tcplog balance source server controller1 10.10.100.150:6080 check inter 5s fastinter 1s downinter 2s rise 3 fall 3 server controller2 10.10.100.149:6080 check inter 5s fastinter 1s downinter 2s rise 3 fall 3 server controller3 10.10.100.148:6080 check inter 5s fastinter 1s downinter 2s rise 3 fall 3 listen neutron_metadata_api bind 10.10.100.95:8775 option tcpka option tcplog balance source server controller1 10.10.100.150:8775 check inter 5s fastinter 1s downinter 2s rise 3 fall 3 server controller2 10.10.100.149:8775 check inter 5s fastinter 1s downinter 2s rise 3 fall 3 server controller3 10.10.100.148:8775 check inter 5s fastinter 1s downinter 2s rise 3 fall 3 listen neutron_api bind 10.10.100.95:9696 option tcpka option httpchk option tcplog balance source server controller1 10.10.100.150:9696 check inter 5s fastinter 1s downinter 2s rise 3 fall 3 server controller2 10.10.100.149:9696 check inter 5s fastinter 1s downinter 2s rise 3 fall 3 server controller3 10.10.100.148:9696 check inter 5s fastinter 1s downinter 2s rise 3 fall 3 listen glance_api bind 10.10.100.96:9292 option tcpka option httpchk option tcplog balance source server controller1 10.10.100.150:9292 check inter 5s fastinter 1s downinter 2s rise 3 fall 3 server controller2 10.10.100.149:9292 check inter 5s fastinter 1s downinter 2s rise 3 fall 3 server controller3 10.10.100.148:9292 check inter 5s fastinter 1s downinter 2s rise 3 fall 3 listen glance_registry bind 10.10.100.96:9191 option tcpka option tcplog balance source server controller1 10.10.100.150:9191 check inter 5s fastinter 1s downinter 2s rise 3 fall 3 server controller2 10.10.100.149:9191 check inter 5s fastinter 1s downinter 2s rise 3 fall 3 server controller3 10.10.100.148:9191 check inter 5s fastinter 1s downinter 2s rise 3 fall 3 listen keystone_admin bind 10.10.100.97:35357 option tcpka option httpchk option tcplog balance source server controller1 10.10.100.150:35357 check inter 5s fastinter 1s downinter 2s rise 3 fall 3 server controller2 10.10.100.149:35357 check inter 5s fastinter 1s downinter 2s rise 3 fall 3 server controller3 10.10.100.148:35357 check inter 5s fastinter 1s downinter 2s rise 3 fall 3 listen keystone_public bind 10.10.100.97:5000 option tcpka option httpchk option tcplog balance source server controller1 10.10.100.150:5000 check inter 5s fastinter 1s downinter 2s rise 3 fall 3 server controller2 10.10.100.149:5000 check inter 5s fastinter 1s downinter 2s rise 3 fall 3 server controller3 10.10.100.148:5000 check inter 5s fastinter 1s downinter 2s rise 3 fall 3 listen dashboard bind 10.10.100.97:80 option tcpka option httpchk option tcplog balance source server controller1 10.10.100.150:80 check inter 5s rise 2 fall 3 server controller2 10.10.100.149:80 check inter 5s rise 2 fall 3 server controller3 10.10.100.148:80 check inter 5s rise 2 fall 3 listen rabbitmq bind 10.10.100.98:5672 timeout client 12h timeout server 12h mode tcp option tcpka option clitcpka balance roundrobin server controller1 10.10.100.150:5672 weight 9 server controller2 10.10.100.149:5672 weight 9 backup server controller3 10.10.100.148:5672 weight 5 backup #Openstack通过VIP连接RabbitMQ时,如果采用如下方案,Nova-api会报错 #server controller2 10.10.100.150:5672 check inter 5s fastinter 1s downinter 2s rise 3 fall 3 #server controller2 10.10.100.149:5672 check inter 5s fastinter 1s downinter 2s rise 3 fall 3 #server controller3 10.10.100.148:5672 check inter 5s fastinter 1s downinter 2s rise 3 fall 3 listen mariadb bind 10.10.100.99:3306 timeout client 24h timeout server 24h #如果未开启集群监控脚本,请使用如下配置 #balance source #mode tcp #server controller1 10.10.100.150:3306 check inter 1000 rise 2 fall 3 #server controller2 10.10.100.149:3306 check inter 1000 rise 2 fall 3 #server controller3 10.10.100.148:3306 check inter 1000 rise 2 fall 3 #如果开启了集群监控脚本,请使用如下配置 balance leastconn option httpchk mode tcp server node1 10.10.100.150:3306 check port 9200 inter 3s fastinter 1s rise 3 fall 3 server node2 10.10.100.149:3306 check port 9200 inter 3s fastinter 1s rise 3 fall 3 server node3 10.10.100.148:3306 check port 9200 inter 3s fastinter 1s rise 3 fall 3 backup listen stats bind 0.0.0.0:8080 mode http stats enable stats refresh 30s stats uri /stats stats realm openstack\ Haproxy stats auth admin:admin stats hide-version stats show-node stats show-legends |
原创文章禁止转载:技术学堂 » Openstack云平台搭建课程八·控制节点集群