NAPTR和SRV均可以实现后台服务器的master/slave和load balancing。但是两者实现的粒度不一样,所以两者通常结合起来使用。通过NAPTR可以查找服务(service),通过SRV可以查找某个service的细节比如协议,PORT,server。
1 SRV(service location)
The SRV RR allows administrators to use several servers for a singledomain, to move services from host to host with little fuss, and to designatesome hosts as primary servers for a service and others as backups. SRV can beused for load balancing.
SRV可实现负载均衡和高可靠性。
●service
对应的service名称
●protocol
协议名称。常用的有TCP,UDP,_x-3gpp-pgw
●name
除掉服务和协议后的域名。
●priority
值越低,优先级越高。只能选择优先级最高的。利用这个字段可以实现master/slave。
●weight
用于负载均衡,如果priority一样,则需要把请求安装weight指示的比例分配到各个target上。和priority