Bootstrap

nginx配置多组upstream实现微服务负载均衡

1.nginx.conf配置如下

    upstream loadbalance_user {
                                 //可写入多个后台地址,实现负载均衡
        server  192.168.1.189:5007   weight=1;
        server  192.168.1.164:5007   weight=1;
    }
    upstream loadbalance_log {
   
        server  192.168.1.189:5007   weight=1;
        server  192.168.1.164:5007   weight=1;
    }
    upstream loadbalance_login {
   
        server  192.168.1.189:5002   weight=1;
        server  192.168.1.164:5002   weight=1;
    
;