nginx负载均衡
ngixn负载均衡
分为四层和七层负载均衡
nginx负载均衡
配置语法:
Syntax: upstream name{...} Default:- Context: http
配置示例:
upstream举例
upstream backend{ server backend1.example.com weight=5;--代表权重 server backend2.example.com:8080; server unix:/tmp/backend3; server backup1.example.com:8080 backup; server backup2.example.com:8080 backup; }
后端服务器在负载均衡调度中的状态
nginx的调度算法: