OpenStack lbaas haproxy v1v2配置

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版本配置)

转载于:https://my.oschina.net/ccc4b/blog/834683

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值