添加一个负载完整的过程为:
配置slb server 即所谓的real server,后端真实提供服务的主机
配置slb service-group 定义服务组,里面包含哪些real server主机
配置slb virtual-server 即virtual server,对外提供服务的地址
贴一个简单的配置供参考:
1、配置server,当然得是在configure模式下
slb server apache01 172.16.2.10 port 8080 tcp slb server apache02 172.16.2.11 port 8080 tcp slb server nginx01 172.16.2.20 port 8000 tcp slb server nginx02 172.16.2.21 port 8000 tcp
2、配置service-group
slb service-group apache tcp member apache01:8080 member apache02:8080 slb service-group nginx tcp member nginx01:8000 member nginx02:8000
3、配置virtual-server(此例配置在一个虚IP下,可以配置多个)
slb virtual-server apache&nginx 172.16.1.50 ha-group 1 port 8080 tcp name 172.16.2.50_TCP_8080 access-list 100 source-nat-pool SNAT slb service-group apache ha-conn-mirror template persist source-ip source_ip_persist port 8000 tcp name 172.16.2.50_TCP_8000 access-list 100 source-nat-pool SNAT slb service-group nginx ha-conn-mirror template persist source-ip source_ip_persist
这样一个简单的负载就添加完成了。
A10负载设备命令与Cisco设备命令基本一致,但是也有区别。
cisco设备主备切换命令为:
redundancy force-switchover
A10设备主备切换命令为:
ha force-self-standby
A10还原原来主备状态:
no ha force-self-standy
时间: 2024-10-04 18:26:04