linux搭建nginx负载均衡
发布日期:2022-03-18 05:04:10 浏览次数:4 分类:技术文章

本文共 536 字,大约阅读时间需要 1 分钟。

1,思路

需要最少3台服务器
192.168.1.155
192.168.1.156
192.168.1.157

1,155是主服务器

配置如下

upstream westos{
#最少连接策略 # least_conn; #IP绑定策略 # ip_hash; server 192.168.1.156:80 weight=2; server 192.168.1.157:80 weight=1; } server {
listen 80; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / {
proxy_pass http://westos; }

两台需要进行资源分配的服务器,轮训,权重…配置,这里配置156服务器权重为2,概率为3/2

157权重为1 ,概率为3/1
156
157

转载地址:https://blog.csdn.net/qq_37430469/article/details/121562227 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:git拉取代码生成流水线获取凭证id 以及harbor凭证id
下一篇:Linux环境搭建Elasticsearch以及Elasticsearch-head安装全流程

发表评论

最新留言

感谢大佬
[***.8.128.20]2024年03月22日 22时20分45秒