F5上的设置:
1、建立各域名对应的IP池:
Local Traffic->pool->create
Health Monitors 选择一个设置好的monitors(先要设置增加一个monitors,如:http_monitor )
在member增加成员IP及对应服务(即端口号)并确定为enable(图标为绿色)
创建2个IP池 vipdnspool和hahadnspool,具体的IP设置自己定,
如vipdnspool包括192.168.1.1和192.168.1.2
hahadnspool包括192.168.1.3 和192.168.1.2
2、建立泛域名中子域名的的应用规则
Local Traffic->iRules->create
规则内容如下:
when HTTP_REQUEST {
if {[HTTP::host] equals "vip.test.com" } {
pool vipdnspool
}
if {[HTTP::host] equals "haha.test.com" } {
pool hahadnspool
}
}
即根据提供的域名来对应到建立的IP池,如筹建的规则名为:DNSrule
3、建立虚拟主机
Local Traffic->Virtual Servers->create
Configuration: 要选advanced,因为要调用irules,所以要在里面设置
HTTP Profile =http参数和SNAT Pool =auto map
在sources界面中进行选择irules中的规则DNSrule
本文详细介绍如何在F5设备上配置基于域名的负载均衡,包括设置IP池、创建应用规则及虚拟主机的具体步骤。
4461

被折叠的 条评论
为什么被折叠?



