Neutron LBaaS Service(1)—— Neutron LBaaS Service基本知识
在OpenStack Grizzly版本中,Quantum组件引入了一个新的网络服务:LoadBalancer(LBaaS),服务的架构遵从Service Insertion框架。LoadBalancer为租户提供到一组虚拟机的流量的负载均衡,其基本实现为:在neutron-lbaas-agent中生成Haproxy的配置文件然后启动Haproxy。
Neutron LBaaS Service Architecture

LBaaS主要由以下几个模块构成,如下图所示
- Loadbalancer 处理Restful API
- LoadBalancerPlugin,This class manages the workflow of LBaaS request/response. Most DB related works are implemented in class loadbalancer_db.LoadBalancerPluginDb
- Scheduler: loadbalancer_pool_scheduler_driver = neutron.services.loadbalancer.agent_scheduler.ChanceScheduler 负责为vip分配相应的agent
- lbaas-agent 接收plugin消息,并将请求转发给device_driver(HaproxyNSDriver)执行
- HaproxyNSDriver 实现负载均衡的device driver,生成Haproxy的配置文件然后启动Haproxy

LBaaS数据模型

如上图所示,数据模型主要由Pool,VIP,Member,HealthMonitor等四个对象组成。
- 处在核心位置的是Pool(我倾向于把它命名成loadballancer), 它代表一个负载均衡器。
- 一个负载均衡器拥有一个VIP,也就是虚拟IP。虚拟IP中的虚拟其实是相对后面的Member而言,也就是说这个VIP不固定在任何一个Member上。用户访问这个VIP,有时由这个成员提供服务,有时由那个成员提供服务。
- Member是后台提供服务的服务器。
- HealthMonitor用来监控和检查后台服务器的联通情况。当检查到某个服务器不能使用时,负载均衡器就不会用它来向用户提供服务。一个pool可对应多个health monitor。有四种类型:PING、TCP、HTTP、HTTPS。每种类型就是使用相应的协议对member进行检测。
除了以上四个对象,Session Persistence和Connection Limits这两个特性也比较重要:
- Session Persistence规定session相同的连接或请求转发的行为。目前支持三种类型:
- SOURCE_IP:指从同一个IP发来的连接请求被某个member接收处理;
- HTTP_COOKIE:该模式下,loadbalancer为客户端的第一次连接生成cookie,后续携带该cookie的请求会被某个member处理
- APP_COOKIE:该模式下,依靠后端应用服务器生成的cookie决定被某个member处理
- Connection Limits 这个特性主要用来抵御DDoS攻击
LBaaS部署方法
1. DevStack中,增加 ENABLED_SERVICES+=,q-lbaas 选项即可;
2. RDO部署: packstack --allinone --neutron-lbaas-hosts=192.168.1.10 (具体步骤参考:http://openstack.redhat.com/LBaaS)
3. 也可以使用Openstack Heat来部署LBaaS,具体见http://blog.csdn.net/lin_victor/article/details/23060467
For LBaaS to be configured properly, various configuration files must have the following changes. The service_provider parameter should be set in /usr/share/neutron/neutron-dist.conf: service_provider = LOADBALANCER:Haproxy:neutron.services.loadbalancer.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default The service_plugin should be set in /etc/neutron/neutron.conf: service_plugins = neutron.services.loadbalancer.plugin.LoadBalancerPlugin The interface_driver and device_driver should be set in /etc/neutron/lbaas_agent.ini. Since the load balancer will be haproxy, set the device_driver accordingly: device_driver = neutron.services.loadbalancer.drivers.haproxy.namespace_driver.HaproxyNSDriver The interface_driver will depend on the core L2 plugin being used. For OpenVSwitch: interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver For linuxbridge: interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver If the above configuration files were changed manually, restart the neutron-server service and neutron-lbaas-agent service.
LBaaS使用方法

基本的使用步骤为:
- 租户创建一个pool,初始时的member个数为0;
- 租户在该pool内创建一个或多个member
- 租户创建一个或多个health monitor
- 租户将health monitors与pool关联
- 租户使用pool创建vip
UnitedStack博客中整理一个详细的使用步骤:https://www.ustack.com/2013/10/08/neutron_loadbalance/
参考文献
https://wiki.openstack.org/wiki/Neutron_LBaaS_Arch
https://wiki.openstack.org/wiki/Neutron/LBaaS/Architecture/Scheduler
http://openstack.redhat.com/LBaaS
https://www.ustack.com/2013/10/08/neutron_loadbalance/
http://blog.csdn.net/matt_mao/article/details/12982963
http://blog.csdn.net/lynn_kong/article/details/8528512
Neutron LBaaS Service(1)—— Neutron LBaaS Service基本知识的更多相关文章
- WCF Failed to invoke the service. Possible causes: The service is offline or inaccessible
今天写WCf 时遇到如下报错: 调试过程发现,各个过程都无异常,但是返回给调用端数据时出现如下错误. Failed to invoke the service. Possible causes: Th ...
- 服务链(Service Chaining,or Service Function Chaining,SFC,功能服务链)
Software-configured service chaining provides the capability to dynamically include best-of-b ...
- Android Service、IntentService,Service和组件间通信
Service组件 Service 和Activity 一样同为Android 的四大组件之一,并且他们都有各自的生命周期,要想掌握Service 的用法,那就要了解Service 的生命周期有哪些方 ...
- Service Fabric —— Actor / Stateless Service 概念
作者:潘罡 (Van Pan) @ Microsoft 上一节我们谈到了Stateful Service.在Service Fabric中,Stateful Service是理解Micro Servi ...
- How to Remove A Service Entry From Win10 Service List
Warning Please do this operation CAREFULLY, otherwise you may get something wrong with your system. ...
- 【起航计划 033】2015 起航计划 Android APIDemo的魔鬼步伐 32 App->Service->Foreground Service Controller service使用,共享service,前台服务,onStartCommand
Android系统也提供了一种称为“Service”的组件通常在后台运行.Activity 可以用来启动一个Service,Service启动后可以保持在后台一直运行,即使启动它的Activity退出 ...
- svcs (service status) 和 svcadm (service administration) 使用
1. svcs 显示服务实例的状态信息 svcs - report service status 显示服务状态命令 DESCRIPTION The svcs command displays in ...
- AttributeError: module 'selenium.webdriver.common.service' has no attribute 'Service'
今天爬虫时需要使用到selenium, 使用pip install selenium进行安装. 可是一开始写程序就遇到了AttributeError: module 'selenium.webdriv ...
- Service Started!!!-end In Service while
将原先的win7换成了xp,用体验换来更好的兼容 问题如下: 在虚拟机器中运行了DebugView后,就一直重复出现Service Started!!!-end In Service while, 虽 ...
- Android中Service通信(二)——绑定Service进行通信
一.把输入文本的数据同步到服务的实例(如何执行服务的内部代码) 绑定服务比启动服务更加方便高效,绑定服务中的直接方法调用比Intent作为载体传输更为快捷得多. 1.activity_main.xml ...
随机推荐
- Openstack学习历程_1_视频
学习视频:讲解Openstack每个模块对应的作用
- php中将url中的参数含有%20进行转换或解码
我的url: .......index.php?action=search&start=12&search=star wave&orderby=categories&s ...
- test Windows Live Writer
1, 下载Live Writer http://windows.microsoft.com/zh-cn/windows-live/essentials-other#essentials=overvie ...
- Linux上的free命令学习
Linux新手,今天使用了free命令来查看电脑内存的使用情况.如下:-m表示以M来显示. 1.基本信息介绍 (1)其中纵向信息: Mem:表示物理内存大小 -/+ buffers/cached:表示 ...
- 优秀HTML5活动页面
一个好的手机活动宣传 更能让人分享 传播是爆炸性的 下面是我平时看到一些好的微信活动宣传页面 分享给大家 其中用到的技术 常做微信活动 专题页面的人 可以看看大神们是怎么做的 这样到自己做的时候 ...
- 关于duplicate symbol _main in的解决办法
报错:duplicate symbol _main in: duplicate symbol _main in: /Users/gavin/Library/Developer/Xcode/Der ...
- poj1502 最短路
题意:有n个处理器,给出n*n的邻接矩阵的一半,表示相互之间传输信息的花费(另一半与给出的一半对称,即双向都可传输),x表示不能传输,问从第一个处理器传输到所有处理器的最小花费总和是多少. 就是跑一遍 ...
- Android项目——短信发送器
因为应用要使用手机的短信服务,所以要在清单文件AndroidManifest.xml中添加短信服务权限: <?xml version="1.0" encoding=" ...
- thinkphp3.2 学习
http://www.tuicool.com/articles/nQFnQrR 1,sublime text 增强插件 右键可以打开文件目录 http://www.w3cfuns.com/notes/ ...
- php 代码大全
1.子类访问父类静态方法 <?php class A{ static function loadById(){ $class_name = get_called_class(); $model ...