lbaas v2 haproxy###
一 安装软件
# apt-get install haproxy neutron-lbaasv2-agent
# yum install haproxy neutron-lbaasv2-agent
二 配置 LBaaS v2 with an agent
1 # vi /etc/neutron/neutron.conf 在已有的plugins后面添加
service_plugins = [existing service plugins],neutron_lbaas.services.loadbalancer.plugin.LoadBalancerPluginv2
2 # vi /etc/neutron/neutron_lbaas.conf 添加下面一行
service_provider = LOADBALANCERV2:Haproxy:neutron_lbaas.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default
3 在/etc/neutron/lbaas_agent.ini文件中启用HAProxy负载均衡器
# vi /etc/neutron/lbaas_agent.ini
[DEFAULT]
interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver
[haproxy]
user_group = haproxy
4 运行neutron-lbaas数据库迁移
# neutron-db-manage --service lbaas upgrade head
如果您已部署LBaaS v1,现在停止LBaaS v1代理。 v1和v2代理无法同时运行。
5 重启服务
# service neutron-lbaasv2-agent restart
# service neutron-server restart
三 查看日志
# tail -f /var/log/neutron/neutron-lbaasv2-agent.log
四 创建测试(horizon界面暂不支持v2版本)
# neutron lbaas-loadbalancer-create --name test-lb test108
# neutron lbaas-loadbalancer-show test-lb
# neutron security-group-create lbaas
# neutron security-group-rule-create --direction ingress --protocol tcp --port-range-min 80 --port-range-max 80 --remote-ip-prefix 0.0.0.0/0 lbaas
# neutron security-group-rule-create --direction ingress --protocol tcp --port-range-min 443 --port-range-max 443 --remote-ip-prefix 0.0.0.0/0 lbaas
# neutron security-group-rule-create --direction ingress --protocol icmp lbaas
# neutron port-update --security-group lbaas $PORT-ID
# neutron lbaas-listener-create --name test-lb-http --loadbalancer test-lb --protocol HTTP --protocol-port 80
# neutron lbaas-pool-create --name test-lb-pool-http --lb-algorithm ROUND_ROBIN --listener test-lb-http --protocol HTTP
# neutron lbaas-member-create --subnet test108 --address 192.168.108.126 --protocol-port 80 test-lb-pool-http
# ping ip
# ps aux |grep haproxy
lbaas v1 haproxy
一 安装软件
# apt-get install haproxy neutron-lbaas-agent
1 # vi /etc/neutron/neutron.conf 在已有的plugins后面添加
service_plugins = lbaas
2 # vi /etc/neutron/neutron_lbaas.conf 添加下面一行
service_provider = LOADBALANCER:Haproxy:neutron_lbaas.services.loadbalancer.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default
3 在/etc/neutron/lbaas_agent.ini文件中启用HAProxy负载均衡器
# vi /etc/neutron/lbaas_agent.ini
[DEFAULT]
###在文件/etc/neutron/lbaas_agent.ini中选择所需要的驱动##
###激活Open vSwitch 负载均衡即服务驱动:
###interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver
###或者,激活Linux网桥负载均衡即服务驱动:
###interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver
interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver
[haproxy]
user_group = haproxy
4 在数据库中创建所要求的表:
# neutron-db-manage --service lbaas upgrade head
5 重启服务 如果您已部署LBaaS v2,现在停止LBaaS v2代理。 v1和v2代理无法同时运行。
# service neutron-lbaas-agent restart
# service neutron-server restart
二 查看日志
# tail -f /var/log/neutron/neutron-lbaas-agent.log
三 创建测试(horizon界面支持v1版本配置)