nginx负载均衡

lys07962000 2016-10-02 03:49:44
192.168.1.3
192.168.1.4
192.168.1.5
拿三台机器做测试
nginx负载均衡
百度好多方法,都没成功!!!
有介绍比较全的?
...全文
932 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
小白晒太阳 2016-10-12
  • 打赏
  • 举报
回复

upstream balance_test{
        server 192.168.1.3:8080;
        server 192.168.1.4:8080;
        server 192.168.1.5:8080;
    }

在192.168.1.3-192.168.1.5 3台机器上都部署同一个web项目, nginx.conf配置server里面location ,将匹配到test开头的请求打向上面配置的3台机器对应的,默认轮询方式,第一次请求打到1.3,第二次1.4,第三次1.5,达到3台机器一个负载均衡效果。
	
location ^~ /test/ {
            proxy_pass http://balance_test;
        }
lys07962000 2016-10-03
  • 打赏
  • 举报
回复
再做了一次 http://www.cnblogs.com/xiaogangqq123/archive/2011/03/04/1971002.html 解决了
lys07962000 2016-10-03
  • 打赏
  • 举报
回复
https://github.com/shaoyihe/dev-document/tree/master/nginx 无法打开啊!!!!!
funnyone 2016-10-03
  • 打赏
  • 举报
回复
我在一台机器上模拟了3个端口应用,上可以轮训执行3个应用的。 代码在 https://github.com/shaoyihe/dev-document/tree/master/nginx,不过我应用时ruby写的,不过都一样。
lys07962000 2016-10-02
  • 打赏
  • 举报
回复
http://www.php100.com/html/program/nginx/2013/0905/5525.html http://blog.csdn.net/xyang81/article/details/51702900 http://blog.csdn.net/e421083458/article/details/30086413 这几个方法都没用 192.168.1.3 // 做负载均衡服务器 //////以下2台要如何配置 192.168.1.4// 192.168.1.5

25,988

社区成员

发帖
与我相关
我的任务
社区描述
高性能WEB开发
社区管理员
  • 高性能WEB开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧