每一刻都是一个崭新的开始。

F5 session persistence

今天早上,到支付宝里,随便看了下.
C:\Documents and Settings\Administrator>curl -I http://help.alipay.com/common/
HTTP/1.1 404 Not Found
Date: Mon, 01 Feb 2010 00:53:18 GMT
Server: Apache
Content-Type: text/html; charset=iso-8859-1
Set-Cookie: BIGipServerhelp_80_pool=1187516844.20480.0000; path=/
看来阿里巴巴也在用F5.呵呵.从这里可以看出,用F5做负载均衡,池的名字是"help_80_pool",转个文章

 

类型,会话保持类型(cookies ,源地址,目标地址,sip,hash,ssl等)是F5用来决定怎么判断连接是否是同一连接的。

1.cookie:

insert方式,在http response经过F5时候,F5在http 头部的cookie中增加一个BIGipServer <poolname>:realserver&port

rewrite方式,截取response里名叫BIGipCookie的cookie名,然后改写成BIGipServer <poolname>:realserver&port。这种方式要求服务器在响应中一定要预先这只好一个空cookie,即BIGipCookie.

passive方式,在服务器上预先设好COOKIE,很不推荐这种方式

cookie hash方式,F5维持一个cookie值与node对应的HASH,但F5自己不产生COOKIE,因此一定要求服务器能自动产生COOKIE,如果没有COOKIE这个方式就每意义了

 2.基于目标地址

这种方式将导致不管客户端是谁,只要目标地址相同,就被定向到同一SERVER上,这种方式适合缓存服务器环境下,将所有连接都定向到一台缓存服务器,提高利用率。

3.MSRDP

F5特别为微软远程桌面设计的,利用msrdp persistence 以及windows的会话目录提供终端服务的负载均衡以及会话保持,可以确保用户在需要的时候都能连接到上衣终端服务器,有了msrdp persistence,当连接到错误的终端服务器时,根据会话目录,可以让客户端重新连接到VS上再连接到正确服务器上,或者重新直接定向到正确服务器上。主要分为客户端可看见服务器和客户端看不见服务器模式。详细实践可以参考http://www.mycisco.cn/post/272.html

4.ssl persistence

只适合F5不充当验证SSL验证、响应时候才适合,即只适合简单传输SSL数据时,这个时候是利用记录ssl 会话ID来保持的。

如果F5充当了SSL验证、加解密的时候,需要使用irules来进行会话保持。

5.Universal persistence
Included in the BIG-IP system’s Universal Inspection Engine (UIE) is a set
of functions that you can specify within BIG-IP system iRules to direct
traffic in more granular ways. Using these iRule functions, you can write
expressions that direct traffic based on content data, or direct traffic to a
specific member of a pool.
Universal persistence takes this iRules feature one step further, by allowing
you to implement persistence for sessions based on content data, or based on
connections to a specific member of a pool. Universal persistence does this
by defining some sequence of bytes to use as a session identifier.
To use iRule expressions for persistence, a universal persistence profile
includes a setting that specifies the name of the iRule containing the
expression.
Once you have created an iRule and specified the iRule name within a
universal profile, you must assign both the iRule and the profile to the
appropriate virtual server as resources

标准,标准是F5决定会话保持行为的:

1.match across Services setting

多个VS拥有相同的VIP(端口不同),此时,启用这个标准将产生如下行为:只要连接的VS的VIP相同,对于同一个原地址的请求,都以第一个会话保持信息为准,后续的连接不管是访问哪个VS,都会被定向到同一个pool member(也就是说,同一个客户端访问不同的VIP则使用相同的会话保持信息记录),不考虑会话时间限制。因此这种情况下各个VS关联的POOL应该拥有相同的成员。

这种情况非常适合,在实际服务器部署了多个服务(对外发布了多个相同VIP的VS,端口不一样),但是彼此服务之间要求关联,比如第一次在A服务器上的80端口,要求该客户后续的对其他端口的请求也都在这个A服务器上,则启用这个功能。

2.match across Virtual Servers setting

不管各个VS的VIP是否相同,也不管后续连接是请求到了哪个VS,只要是同一客户端发来的,都按照第一个初始连接的保持信息执行(也就是说只要是同一个客户端的都被定向到同一个pool member)。因此不同的VS应该关联相同的pool成员

3.Match Across Pools setting
When you enable the Match Across Pools setting, the BIG-IP system can
use any pool that contains a given persistence record. The default is disabled
(cleared).

以上转自:http://www.mycisco.cn/post/300.html

相关文章:

http://www.mycisco.cn/post/404.html

http://hi.baidu.com/spiritcarl/blog/item/0590cf1224e96a5bf919b882.html

Tags: f5, bigipserver

« 上一篇 | 下一篇 »

Trackbacks

点击获得Trackback地址,Encode: UTF-8 点击获得Trackback地址,Encode: GB2312 or GBK 点击获得Trackback地址,Encode: BIG5

1条记录访客评论

f5 好TMD贵!

Post by daniel on 2010, February 3, 10:41 AM 引用此文发表评论 #1


发表评论

评论内容 (必填):