温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

OpenStack lbaas haproxy v1v2怎么配置

发布时间:2021-12-07 14:49:07 来源:亿速云 阅读:158 作者:小新 栏目:云计算

这篇文章主要介绍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版本配置)

以上是“OpenStack lbaas haproxy v1v2怎么配置”这篇文章的所有内容,感谢各位的阅读!希望分享的内容对大家有帮助,更多相关知识,欢迎关注亿速云行业资讯频道!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI