其他优化补充说明
哪些组件一般不通过haproxy做负载?
Memcached一般使用Openstack自带的集群管理方案,而不是加入haproxy。
memcached_servers = controller01:11211,controller2:11211,controller3:11211
RabbitMQ用haproxy负载还是用openstack自带的集群管理方案?
Openstack官方建议使用其自带的集群管理方案,但本人一直通过haproxy进行负载,暂未发现问题。
transport_url=rabbit://openstack:Openstack123@10.10.100.98:5672 #transport_url=rabbit://openstack:Openstack123@controller1:5672,controller2:5672,controller3:5672
适用于openstack集群的haproxy的全部配置如下,具体参数可以根据实际情况进行调整:
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云平台搭建课程八·控制节点集群