• nginx负载均衡upstream参数配置


    一定要注意两台机器能够telnet 访问通过  如果不能通过则两台机器都执行一下 iptables -F

    机器A:

    php-fpm配置
    [www]
    user = www
    group = www
    listen = 127.0.0.1:9001
    pm = dynamic
    pm.max_children = 5
    pm.start_servers = 2
    pm.min_spare_servers = 1
    pm.max_spare_servers = 3

    [www]
    user = www
    group = www
    listen = 127.0.0.1:9000
    pm = dynamic
    pm.max_children = 5
    pm.start_servers = 2
    pm.min_spare_servers = 1
    pm.max_spare_servers = 3

    机器A nginx.conf配置

    upstream backend{
          server  127.0.0.1:9000 weight=1;
          server  127.0.0.1:9001 weight=2;
          server  192.168.137.111:9000 weight=3;
          keepalive 3072;
    }

        location ~ .*.php
        {
                fastcgi_pass backend;
                fastcgi_index index.php;
                include fastcgi.conf;
        }

    机器B php-fpm.conf配置


    [www]
    user = www
    group = www
    listen = 192.168.137.111:9000
    pm = dynamic
    pm.max_children = 5
    pm.start_servers = 2
    pm.min_spare_servers = 1
    pm.max_spare_servers = 3
     

    机器B nginx.conf配置

        location ~ .*.php
        {
            fastcgi_pass 192.168.137.111:9000;
            fastcgi_index index.php;
            include fastcgi.conf;
        }

  • 相关阅读:
    Oracle常用系统查询SQL
    easyui中使用的遮罩层
    EasyUI相同的Tab只打开一个(即EasyUI方法的调用方法)
    jQueryEasyUI创建菜单主页
    linux 的环境变量的配置文件
    angular reactive form
    svn代码回滚
    golang restful api
    golang embedded structs
    Angular Multiple HTTP Requests with RxJS
  • 原文地址:https://www.cnblogs.com/sixiong/p/5225357.html
Copyright © 2020-2023  润新知