Nginx负载均衡集群介绍

简介:

第1章 集群介绍

1.1 集群简介

1.1.1 什么是集群

简单说,集群就是一组(若干个)相互独立的计算机,利用高速通信网络组成的一个较大的计算机服务系统,每个集群节点(即集群中的每台计算机)都是运行各自服务的独立服务器,这些服务器之间可以彼此通信,协同向用户提供应用程序,系统资源和数据,并以单一系统的模式加以管理。当用户客户机请求集群系统时,集群给用户的感觉就是一台服务器干一件事。

                           

1.2 集群的优势特点

  • 高性能(performance

一些国家重要的计算密集型应用(如天气预报,核试验模拟等),需要计算机有很强的计算处理能力。以全世界现有的技术,即使是大型机,其计算能力也是有限的,很难单独完成此任务。因为计算时间可能会相当长,也许几天,甚至几年或更久。因此,对于这类复杂的计算业务,便使用了计算机集群技术,集中有几十甚至上百台计算机进行计算。

  • 高可用(availability

   单一的计算机系统总会面临设备损毁的问题,例如:CPU,内存,主板,电源,硬盘等,只要一个部件坏掉,这个计算机系统就有可能会宕机,无法正常提供服务。在集群系统中,尽管硬件和软件也还是会发生故障,但整个系统的服务可以是每天24*7可用的。

  • 数据不能丢

  • 网站7*24不宕机

  • 用户的体验好

高可用性集群常用的开源软件包括keepalivedheartbeat等。


 

1.3 集群的分类

计算机集群架构按功能和结构可以分成以下几类:

  • 负载均衡集群(load balancing clusters,简称LBCLB.

  • 高可用性集群(HIGH-availability(HA)clusters,简称HAC.

  • 高性能计算集群(High-performance(HPC)clusters,简称HPC

  • 网格计算(grid computing

提示:负载均衡和高可用性集群是互联网行业常用的集群架构模式。

负载均衡集群的作用为:

  • 分担用户访问请求及数据流量(负载均衡)。

  • 保持业务连续性,即7*24小时服务(高可用性)

  • 应用于web业务及数据库从库(读)等服务器的业务。

负载均衡集群典型的开源软件包括LVS,Nginx,Haproxy

1.4 常见的集群软硬件介绍

互联网企业常用的开源集群软件有:Nginx(7 [v1.9] 4),LVS(4)haproxy(4,7),keepalived,heartbeat.

应用层(http HTTPS

传输层(tcp

互联网企业常用的商业集群硬件有:F5,netscaler,radware,A10等,工作模式相当于haproxy的工作模式。

淘宝,赶集网,新浪等公司曾使用过Netscaler负载均衡产品。



  • 当企业业务重要,技术力量有薄弱,并且希望出钱购买产品及获取更好的服务时,可以选择硬件负载均衡产品,如F5Netscaler,Radware等,此类公司多为传统的大型非互联网企业,如银行,证券,金融,宝马,奔驰等。

  • 对于门户网站来说,大多会并用软件及硬件产品来分担单一产品的风险,如淘宝,腾讯,新浪等。融资了的企业会购买硬件产品,如赶集网等网站。

  • 中小型互联网企业,由于起步阶段无利润可赚或利润很低,会希望通过使用开源免费的方案来解决问题,因此会雇佣专门的运维人员进行维护。

第2章 Nginx负载均衡集群介绍

2.1 反向代理与负载均衡概念简介

严格的说,nginx仅仅是作为nginxproxy反向代理使用的,因为这个反向代理功能表现的效果是负载均衡的效果,所以本文称之为nginx负载均衡。那么反向代理和负载均衡有什么区别?

普通负载均衡软件,例如大名鼎鼎的LVS,其实现的功能只是对请求数据包的转发(也可能会改写数据包),传递,其中DR模式明显的特征是从负载均衡下面的节点服务器来看,接收到的请求还是来自访问负载均衡器的客户端的真实用户,而反向代理就不一样了,反向代理接受访问用户的请求后,会代理用户重新发起请求代理下的节点服务器,最后把数据返回给客户端用户,在节点服务器看来,访问的节点服务器的客户端用户就是反向代理服务器了,而非真实的网站访问用户。


2.2 负载均衡演示

2.2.1 web服务器上配置站点

2.2.1.1web服务器上配置站点,操作前先备份

[root@web01 ~]# cp/application/nginx/conf/nginx.conf{,.bak.lb}

2.2.1.2创建配置文件

vim/application/nginx/conf/nginx.conf

 

  worker_processes  1;

events {

   worker_connections  1024;

}

http {

   include       mime.types;

   default_type application/octet-stream;

   sendfile        on;

   keepalive_timeout  65;

   log_format  main  '$remote_addr - $remote_user [$time_local]"$request" '

                      '$status $body_bytes_sent"$http_referer" '

                     '"$http_user_agent" "$http_x_forwarded_for"';

 

   server {

        listen       80;

        server_name  www.etiantian.org;

        location / {

            root   html/www;

            index  index.html index.htm;

        }

        access_log  logs/access_www.log  main;

   }

        server {

        listen       80;

        server_name  bbs.etiantian.org;

        location / {

            root   html/bbs;

            index  index.html index.htm;

        }

        access_log  logs/access_bbs.log  main;

   }

}


2.2.1.3创建站点并追加内容到站点目录主页内容

mkdir -p/application/nginx/html/{www,bbs}

for dir in www bbs;do echo"`ifconfig eth0|egrep -o "10.0.0.[0-9]+"` $dir">/application/nginx/html/$dir/bingbing.html;done

2.2.1.4检查语法并重启服务

/application/nginx/sbin/nginx -t

/application/nginx/sbin/nginx -s reload

2.2.1.5lb01 上面进行测试

curl 10.0.0.7/bingbing.html

curl 10.0.0.8/bingbing.html

curl 10.0.0.9/bingbing.html

2.2.2 负载均衡服务器上配置服务

2.2.2.1在负载均衡lb01上配置配置文件()

worker_processes  1;

events {

   worker_connections  1024;

}

http {

   include       mime.types;

   default_type application/octet-stream;

   sendfile        on;

   keepalive_timeout  65;

 

   upstreamserver_pools {

         server 10.0.0.7;

         server 10.0.0.8;

         server 10.0.0.9;

    }      

   

   server {

      listen       80;

      server_name  www.etiantian.org;

      location / {

        proxy_pass http://server_pools;

      }

   }

}

注:多台负载均衡都要配置upstream服务器地址池。

2.2.2.2重启配置文件

[root@lb01 conf]# /application/nginx/sbin/nginx-t

nginx: the configuration file/application/nginx-1.10.2/conf/nginx.conf syntax is ok

nginx: configuration file/application/nginx-1.10.2/conf/nginx.conf test is successful

[root@lb01 conf]# lsof -i:80

COMMAND  PID USER  FD   TYPE DEVICE SIZE/OFF NODENAME

nginx   4717 root   6u  IPv4  16704     0t0  TCP *:http (LISTEN)

nginx   4719 www    6u  IPv4 16704      0t0  TCP *:http (LISTEN)

[root@lb01 conf]#/application/nginx/sbin/nginx -s reload

2.2.2.3测试结果

[root@lb01-05 conf]# curl10.0.0.5/bingbing.html

10.0.0.9

10.0.0.255 www

[root@lb01-05 conf]# curl10.0.0.5/bingbing.html

10.0.0.7

10.0.0.255 www

[root@lb01-05 conf]# curl10.0.0.5/bingbing.html

10.0.0.8

10.0.0.255 www


第3章 负载均衡模块说明

nginx http 功能模块

模块说明

ngx_http_proxy_module

proxy代理模块,用于把请求后抛给服务器节点或upstream 服务器池。

ngx_http_upstream_module

负载均衡模块,可以实现网站的负载均衡功能及节点的健康检查,创建一个池子,web服务器。

 

3.1 Nginxupstream模块

nginx的负载均衡功能依赖于ngx_httpstream_module模块,所支持的代理方式包括proxy_pass,fastcgi_pass,memcached_pass等,新版nginx软件支持的方式有所增加。

ngx_http_upstream_module模块允许nginx定义一组或多组节点服务器组,使用时可以通过proxy_pass代理方式把网站的请求发送到实现定义好的对应的upstream组的名字上,具体写法为“proxy_pass  http://www_server_pools,其中www_server_pools就是一个upstream节点服务器组的名字。

3.1.1 upstreamserver标签参数说明

server标签

参数说明

server 10.0.0.8:80

负载均衡后面的RS配置,可以是IP或域名,如果端口不写,默认是80端口。高并发场景下,IP可以换成域名,通过DNS做负载均衡。

weight=1

代表服务器的权重,默认值是1.权重数字越大表示接受的请求比例越大。

max_fails=1

nginx尝试连接后端主机的次数,这个数值是配合proxy_next_upstreamfastcgi_next_upstreammemcached_next_upstream这三个参数来使用,当nginx接收后返回这三个参数定义的状态码时,会将这个请求转发给正常工作的后端服务器,列如404,502,503max_fails的默认值是1;企业场景:建议2-3次,京东1次,蓝汛10次(CDN),根据业务需求去配置。

fail_timeout=10s

max_fails定义的失败次数后,距离下次检查的间隔时间,默认是10s,如果max_fails5,它就检测5次,如果5次都是502。那么,他就会根据fail_timeout的值,等待10s再去检查,还是只检查一次,如果持续502,在不重新加载nginx配置的情况下,每隔10s都只检测一次,常规业务2-3秒比较合理,比如京东3秒,蓝汛3秒,可根据业务需求去配置。

backup

热备配置(RS节点的高可用),当前面激活的RS都失败后会自动启用热备RS,这标志这个服务器作为备份服务器,若主服务器全部宕机了,就会向他转发请求;注意,当负载调度算法为ip_hash时,后端服务器在负载均衡调度中的状态不能使weightbackup

3.1.1.1nginx upstream weight标签测试

  • 操作前备份

[root@lb01 ~]# cd/application/nginx/conf/

[root@lb01 conf]# pwd

/application/nginx/conf

[root@lb01 conf]# hostname

lb01

[root@lb01 conf]# cpnginx.conf{,.bak.before.upsteam}

[root@lb01 conf]# cat nginx.conf

  • 修改配置文件

worker_processes  1;

events {

   worker_connections  1024;

}

http {

   include       mime.types;

   default_type application/octet-stream;

   sendfile        on;

   keepalive_timeout  65;

   

   

   upstreamserver_pools {

         server 10.0.0.7:80weight=2;

         server 10.0.0.8:80weight=1;

         server 10.0.0.9:80weight=1;

    }       

   

   server {

      listen       80;

      server_name  www.etiantian.org;

      location / {

        proxy_pass http://server_pools;

      }

   }

}

  • 检查语法并重启

/application/nginx/sbin/nginx -t

 

lsof -i:80

/application/nginx/sbin/nginx

  • 测试结果

curl 10.0.0.5/bingbing.html

for i in {1..10};do curl10.0.0.5/bingbing.html;done

3.1.1.2nginx upstream  max_fails fail_timeout标签测试

  • 修改配置文件

worker_processes  1;

events {

   worker_connections  1024;

}

http {

   include       mime.types;

   default_type  application/octet-stream;

   sendfile        on;

   keepalive_timeout  65;

   

   

   upstream server_pools {

         server 10.0.0.7:80 weight=4 max_fails=3 fail_timeout=30s;

         server 10.0.0.8:80 weight=4 max_fails=3 fail_timeout=30s;

#         server 10.0.0.9:80 weight=1;

   }      

   

   server {

      listen       80;

      server_name  www.etiantian.org;

      location / {

        proxy_pass http://server_pools;

      }

   }

}

  • 测试结果:

for n in {1..1000};do curl -s  10.0.0.5/bingbing.html|grep"[78]$";sleep 1;date +%T;done

 

sed -i 'N;s#\n10.0.0.255# #g'/application/nginx/html/{www,bbs}/bingbing.html

3.1.1.3nginx upstream backup标签 测试

  • 修改配置文件

worker_processes  1;

events {

   worker_connections  1024;

}

http {

   include       mime.types;

   default_type  application/octet-stream;

   sendfile        on;

   keepalive_timeout  65;

   

   

   upstream server_pools {

         server 10.0.0.7:80 weight=4 max_fails=3fail_timeout=30s;

         server 10.0.0.8:80 weight=4 max_fails=3 fail_timeout=30s;

         server 10.0.0.9:80 weight=4 max_fails=3fail_timeout=30s backup;

   }      

   

   server {

      listen       80;

      server_name  www.etiantian.org;

      location / {

        proxy_pass http://server_pools;

      }

   }

}

3.2 upstream模块调度算法

调度算法一般分为两类,第一类为静态调度算法,即负载均衡器根据自身设定的规则进行分配,不需要考虑后端节点服务器的情况,例如:rr,wrr,ip_hash等都属于静态调度算法。


 

第二类为动态调度算法,即


3.2.1 WRR权重轮询

 

 

3.2.2 RR轮询

 

3.2.3 IP_hash(静态调度算法)

 

 

3.2.4 least_conn

 

 

 

#####nginx.conf 多个虚拟主机

worker_processes  1;

events {

   worker_connections  1024;

}

http {

   include       mime.types;

   default_type application/octet-stream;

   sendfile        on;

   keepalive_timeout  65;

   

   upstream server_pools {

         server 10.0.0.7:80 weight=4max_fails=3 fail_timeout=30s;

         server 10.0.0.8:80 weight=4max_fails=3 fail_timeout=30s;

         server 10.0.0.9:80 weight=4max_fails=3 fail_timeout=30s;

   }      

   

   server {

      listen       80;

      server_name  www.etiantian.org;

      location / {

        proxy_pass http://server_pools;

        proxy_set_header Host $host;

      }

   }

   server {

      listen       80;

      server_name  bbs.etiantian.org;

      location / {

       proxy_pass http://server_pools;

        proxy_set_header Host $host;

      }

   }

}

注:多个虚拟主机设置主机头:因为一个web服务器中可能有很多的虚拟主机站点,如果使用IP地址访问时,默认每次访问都会到达第一个站点,此时如果加上主机头,访问一个web网站的时候,会有针对性的访问带有的主机头的虚拟主机。

 

X-Forwarded-For

worker_processes  1;

events {

   worker_connections  1024;

}

http {

   include       mime.types;

   default_type application/octet-stream;

   sendfile        on;

   keepalive_timeout  65;

   

   

   upstream server_pools {

         server 10.0.0.7:80 weight=4max_fails=3 fail_timeout=30s;

         server 10.0.0.8:80 weight=4max_fails=3 fail_timeout=30s;

         server 10.0.0.9:80 weight=4max_fails=3 fail_timeout=30s;

   }      

   

   server {

      listen       80;

      server_name  www.etiantian.org;

      location / {

        proxy_pass http://server_pools;

        proxy_set_header  Host $host;

        proxy_set_header X-Forwarded-For $remote_addr;

      }

   }

   server {

      listen       80;

      server_name  bbs.etiantian.org;

      location / {

        proxy_pass http://server_pools;

        proxy_set_header  Host $host;

        proxy_set_header X-Forwarded-For $remote_addr;

      }

   }

}


 

##

##根据用户请求的url目录(URI)进行转发 用户的请求

 

####第一个里程碑-规划 分类

/upload      10.0.0.8:80       upload服务器

/static           10.0.0.7:80       static静态服务器

/            10.0.0.9:80       默认

 

####第二个里程碑-创建澡堂子

 

 

upstream upload_pools {

 server 10.0.0.8:80;

}

 

upstream static_pools {

 server 10.0.0.7:80;

}

 

upstream default_pools {

 server 10.0.0.9:80;

}

 

 

##第三个里程碑-什么时候去某一个澡堂子(条件)

location  ====== 专门用来匹配判断 uri  if ($uri ~ xxxx)

 

 

location /static/ {

    proxy_passhttp://static_pools;

   proxy_set_header Host $host;

   proxy_set_header X-Forwarded-For $remote_addr;

}

 

#将符合upload的请求交给上传服务器池upload_pools,配置如下:

location /upload/ {

    proxy_passhttp://upload_pools;

   proxy_set_header Host $host;

   proxy_set_header X-Forwarded-For $remote_addr;

}

 

#不符合上述规则的请求,默认全部交给动态服务器池default_pools,配置如下:

location / {

    proxy_passhttp://default_pools;

   proxy_set_header Host $host;

   proxy_set_header X-Forwarded-For $remote_addr;

}

 

###第四个里程碑-配置lb负载均衡

 

worker_processes  1;

events {

   worker_connections  1024;

}

http {

   include       mime.types;

   default_type application/octet-stream;

   sendfile        on;

   keepalive_timeout  65;

   log_format  main  '$remote_addr - $remote_user [$time_local]"$request" '

                      '$status $body_bytes_sent"$http_referer" '

                     '"$http_user_agent" "$http_x_forwarded_for"';

                           

                           

    upstreamupload_pools {

      server 10.0.0.8:80;

    }

 

    upstreamstatic_pools {

      server 10.0.0.7:80;

    }

 

    upstreamdefault_pools {

      server 10.0.0.9:80;

    }

 

   server {

        listen 80;

        server_name www.etiantian.org;

    location/static/ {

        proxy_pass http://static_pools;

        proxy_set_header Host $host;

        proxy_set_header X-Forwarded-For$remote_addr;

    }

 

        location /upload/ {

        proxy_pass http://upload_pools;

        proxy_set_header Host $host;

        proxy_set_header X-Forwarded-For$remote_addr;

    }

 

     location / {

        proxy_pass http://default_pools;

        proxy_set_header Host $host;

        proxy_set_header X-Forwarded-For$remote_addr;

    }

         access_log  logs/access_www.log  main;

    }

}

 

###第五个里程碑-创建环境

www.etiantian.org/bingbing.html

www.etiantian.org/upload/bingbing.html

www.etiantian.org/static/bingbing.html

 

##web01

mkdir -p/application/nginx/html/www/upload

echo "web01 upload">/application/nginx/html/www/upload/bingbing.html

 

##web02

mkdir -p/application/nginx/html/www/static

echo "web02 static">/application/nginx/html/www/static/bingbing.html

 

##web03

echo "web03 default" >/application/nginx/html/www/bingbing.html

 

###第五个里程碑-进行测试

 

[root@lb01 conf]# curlwww.etiantian.org/bingbing.html

web03 default

[root@lb01 conf]# curlwww.etiantian.org/static/bingbing.html

web02 static

[root@lb01 conf]# curlwww.etiantian.org/upload/bingbing.html

web01 upload

 

 #####nginx.conflb01 基于 用户的客户端浏览器

worker_processes  1;

events {

   worker_connections  1024;

}

http {

   include       mime.types;

   default_type application/octet-stream;

   sendfile        on;

   keepalive_timeout  65;

   

   upstream upload_pools {

     server 10.0.0.8:80;

   }

   

   upstream static_pools {

     server 10.0.0.7:80;

   }

   

   upstream default_pools {

     server 10.0.0.9:80;

   }

   

   server {

      listen       80;

      server_name  www.etiantian.org;

        location / {

         if ($http_user_agent ~*"MSIE")

 

          {

            proxy_pass http://static_pools;

          }

         if ($http_user_agent ~*"Chrome")

 

          {

            proxy_pass http://upload_pools;

          }

        proxy_pass http://default_pools;

        proxy_set_header Host $host;

        proxy_set_header X-Forwarded-For$remote_addr;

       

      }

   }

}

 

 

[root@lb01 conf]# curl10.0.0.5/bingbing.html

web03 default

[root@lb01 conf]# curl10.0.0.5/static/bingbing.html

<html>

<head><title>404 NotFound</title></head>

<bodybgcolor="white">

<center><h1>404 NotFound</h1></center>

<hr><center>nginx/1.10.2</center>

</body>

</html>

[root@lb01 conf]# curl10.0.0.5/upload/bingbing.html

<html>

<head><title>404 NotFound</title></head>

<body bgcolor="white">

<center><h1>404 NotFound</h1></center>

<hr><center>nginx/1.10.2</center>

</body>

</html>

 

[root@lb01 conf]# curl -A chrome10.0.0.5/upload/bingbing.html

web01 upload

[root@lb01 conf]# curl10.0.0.5/bingbing.html

web03 default

[root@lb01 conf]# curl -A msie10.0.0.5/static/bingbing.html

web02 static

 

[root@lb01 conf]# ####访问一个目录  nginx 默认找的文件是 index.html index.htm

[root@lb01 conf]# #####如果这些文件不存在  nginx报错 403

[root@lb01 conf]# curl -A chrome10.0.0.5/upload/oldboy.txt

<html>

<head><title>404 NotFound</title></head>

<bodybgcolor="white">

<center><h1>404 NotFound</h1></center>

<hr><center>nginx/1.10.2</center>

</body>

</html>

 

404错误

[root@lb01 conf]# ####1.10.0.0.5  访问我的反向代理 lb01

[root@lb01 conf]# ####2.10.0.0.5 默认访问第一个虚拟主机 server 

[root@lb01 conf]# ####3.查看对应的条件 uri 目录

[root@lb01 conf]#         # if ($http_user_agent ~*"MSIE")

[root@lb01 conf]#         #

[root@lb01 conf]#         # {

[root@lb01 conf]#         #   proxy_pass http://static_pools;

[root@lb01 conf]#         # }

[root@lb01 conf]#         # if ($http_user_agent ~*"Chrome")

[root@lb01 conf]#         #

[root@lb01 conf]#         # {

[root@lb01 conf]#         #   proxy_pass http://upload_pools;

[root@lb01 conf]#         # }

[root@lb01 conf]#         #proxy_pass http://default_pools;

[root@lb01 conf]# ####4.最后找到的是 默认的池塘 里面没有 upload 目录

[root@lb01 conf]# ####5. 没有这个目录 404 找不到

[root@lb01 conf]# curl  10.0.0.5/upload/

<html>

<head><title>404 NotFound</title></head>

<bodybgcolor="white">

<center><h1>404 NotFound</h1></center>

<hr><center>nginx/1.10.2</center>

</body>

</html>

403错误

[root@lb01 conf]# curl -A msie  10.0.0.5/static/

<html>

<head><title>403Forbidden</title></head>

<bodybgcolor="white">

<center><h1>403Forbidden</h1></center>

<hr><center>nginx/1.10.2</center>

</body>

</html>

[root@lb01 conf]# ####1.lb01

[root@lb01 conf]# ####2.匹配的是第一个虚拟主机 10.0.0.5  www.etiantian.org

[root@lb01 conf]# ####3.进入location

[root@lb01 conf]#         # if ($http_user_agent ~*"MSIE")

[root@lb01 conf]#         #

[root@lb01 conf]#         # {

[root@lb01 conf]#         #   proxy_pass http://static_pools;

[root@lb01 conf]#         # }

[root@lb01 conf]#         # if ($http_user_agent ~*"Chrome")

[root@lb01 conf]#         #

[root@lb01 conf]#         # {

[root@lb01 conf]#         #   proxy_pass http://upload_pools;

[root@lb01 conf]#         # }

[root@lb01 conf]# ####5.判断

[root@lb01 conf]# ####-A 装作是msie

[root@lb01 conf]# ####6.扔到了static_pools  10.0.0.7

[root@lb01 conf]# ####7.10.0.0.7 这个机器上面  /static 目录

[root@lb01 conf]#####8.10.0.0.5/static/  =====10.0.0.5/static/index.html

[root@lb01 conf]# ####9.找首页文件 但是 首页文件不存在就显示403     默认去找index.html

[root@lb01 conf]#

[root@lb01 conf]# ####10.找不到就汇报403 错误 

##1.浏览器缓存 ctrl+F5

##2.域名没有解析

##3.修改了配置文件,没重启  配置文件没生效

本文转自写个博客骗钱博客51CTO博客,原文链接http://blog.51cto.com/dadonggg/1946509如需转载请自行联系原作者


菜鸟东哥

相关实践学习
部署高可用架构
本场景主要介绍如何使用云服务器ECS、负载均衡SLB、云数据库RDS和数据传输服务产品来部署多可用区高可用架构。
负载均衡入门与产品使用指南
负载均衡(Server Load Balancer)是对多台云服务器进行流量分发的负载均衡服务,可以通过流量分发扩展应用系统对外的服务能力,通过消除单点故障提升应用系统的可用性。 本课程主要介绍负载均衡的相关技术以及阿里云负载均衡产品的使用方法。
相关文章
|
10天前
|
负载均衡 算法 应用服务中间件
面试题:Nginx有哪些负载均衡算法?Nginx位于七层网络结构中的哪一层?
字节跳动面试题:Nginx有哪些负载均衡算法?Nginx位于七层网络结构中的哪一层?
28 0
|
2月前
|
负载均衡 Java 应用服务中间件
|
2月前
|
负载均衡 监控 应用服务中间件
Nginx负载均衡:你的网站流量翻倍利器
Nginx负载均衡:你的网站流量翻倍利器
42 0
|
2月前
|
消息中间件 关系型数据库 MySQL
使用Nginx的stream模块实现MySQL反向代理与RabbitMQ负载均衡
使用Nginx的stream模块实现MySQL反向代理与RabbitMQ负载均衡
60 0
|
3月前
|
缓存 负载均衡 算法
【Nginx】Nginx 负载均衡
【1月更文挑战第25天】【Nginx】Nginx 负载均衡
|
3月前
|
负载均衡 应用服务中间件 nginx
【实践】使用Nginx作为GrayLog日志接入的负载均衡
【实践】使用Nginx作为GrayLog日志接入的负载均衡
44 0
|
3月前
|
负载均衡 算法 应用服务中间件
深入了解Nginx底层负载均衡算法
深入了解Nginx底层负载均衡算法
33 0
|
3月前
|
负载均衡 应用服务中间件 nginx
百度搜索:蓝易云【Nginx和tomcat实现负载均衡教程】
至此,你已经成功地使用Nginx和Tomcat实现了负载均衡。Nginx将根据配置的负载均衡策略将客户端请求分发到多个Tomcat服务器上,以提高系统的性能和可用性。请注意,在实际生产环境中,还需要进行其他配置和优化,如健康检查、会话保持等,以满足具体的需求。
34 0
|
3月前
|
负载均衡 安全 前端开发
百度搜索:蓝易云【Nginx与Tomcat负载均衡-动静分离教程】
这些是将Nginx与Tomcat结合使用实现负载均衡和动静分离的基本步骤。根据您的需求和具体环境,可能还需要进行其他配置和调整。请确保在进行任何与网络连接和安全相关的操作之前,详细了解您的网络环境和安全需求,并采取适当的安全措施。
48 1
|
4月前
|
负载均衡 前端开发 应用服务中间件
Nginx中的负载均衡有哪几种方式?
Nginx中的负载均衡有哪几种方式?
54 0