当前位置: 首页 > news >正文

南昌专业网站建设公司哪家好seo专家招聘

南昌专业网站建设公司哪家好,seo专家招聘,网站建设介绍大全,做中医考研真题的网站负载均衡 官网文档 Using nginx as HTTP load balancer nginx中实现反向代理的方式 HTTP:通过nginx配置反向代理到后端服务器,nginx将接收到的HTTP请求转发给后端服务器。使用 proxy_pass 命令 HTTPS:通过nginx配置反向代理到后端服务器&…

负载均衡

官网文档 Using nginx as HTTP load balancer

nginx中实现反向代理的方式

HTTP:通过nginx配置反向代理到后端服务器,nginx将接收到的HTTP请求转发给后端服务器。使用 proxy_pass 命令

HTTPS:通过nginx配置反向代理到后端服务器,nginx将接收到的HTTPS请求转发给后端服务器。使用 proxy_pass 命令

FastCGI:一种常见的反向代理方式,通过将CGI程序从网络上收到的大量请求和应答保存在内存中来提高性能。使用 fastcgi_pass 命令

uwsgi:一种Python的WSGI服务器,它支持WebSocket协议,并且可以与nginx一起使用作为反向代理。使用 muwsgi_pass  命令

SCGI:一种简单的CGI协议,它可以在nginx中用作反向代理,通常用于处理大量小文件请求。使用 scgi_pass 命令

memcached:一种内存对象缓存系统,nginx可以通过反向代理将请求转发到memcached服务器来获取缓存的数据。使用 memcached_pass 命令

gRPC:一种高性能、开源和通用的 RPC(远程过程调用)框架,nginx可以通过反向代理将请求转发到支持gRPC的后端服务器。使用 grpc_pass 命令

负载均衡策略

轮询-round-robin-Nginx默认策略

对应用服务器的请求以轮询方式分发。

http {upstream myapp1 {server srv1.example.com;server srv2.example.com;server srv3.example.com;}server {listen 80;location / {proxy_pass http://myapp1;}}
}

加权轮询-weight

如下所示,假设有5个请求,则3个请求被定向到srv1,1个请求被定向到srv2,1个请求被定向到srv3

 upstream myapp1 {server srv1.example.com weight=3;server srv2.example.com;server srv3.example.com;}

最少连接-least-connected

下一个请求被分配给具有最少活动连接数的服务器。 使用 least_conn 命令

upstream myapp1 {least_conn;server srv1.example.com;server srv2.example.com;server srv3.example.com;}

ip-hash

使来自同一个客户端(基于客户端IP)的请求始终定向至某一个服务器

upstream myapp1 {ip_hash;server srv1.example.com;server srv2.example.com;server srv3.example.com;
}

实验

192.168.28.158nginx实现反向代理
192.168.28.160tomcatweb1服务器
192.168.28.162tomcatweb2服务器

配置nginx

[root@nginx ~]# yum -y install yum-utils
[root@nginx ~]# vim /etc/yum.repos.d/nginx.repo
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true[nginx-mainline]
name=nginx mainline repo
baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true[root@nginx ~]# yum makecache
upstream tomcat {    指定后台服务器server 192.168.28.160:8080;server 192.168.28.162:8080;
}
server {listen       80;server_name  localhost;#access_log  /var/log/nginx/host.access.log  main;location / {
#        root   /usr/share/nginx/html;
#        index  index.html index.htm;proxy_pass http://tomcat;    指定upstream组名}
...

配置web,web1和web2两者配置一致

[root@web1 ~]# ls
anaconda-ks.cfg  apache-tomcat-7.0.42.tar.gz  jdk-8u151-linux-x64.tar.gz  original-ks.cfg
[root@web1 ~]# tar -zx -f jdk-8u151-linux-x64.tar.gz -C /usr/local/
[root@web1 ~]# ln -s /usr/local/jdk1.8.0_151/ /usr/local/java
[root@web1 ~]# sed -i '$a \export JAVA_HOME=/usr/local/java\nexport PATH=$PATH:$JAVA_HOME/bin' /etc/profile
[root@web1 ~]# source /etc/profile
[root@web1 ~]# java -version
java version "1.8.0_151"
Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)[root@web1 ~]# tar -zx -f apache-tomcat-7.0.42.tar.gz -C /usr/local/
[root@web1 ~]# ln -s /usr/local/apache-tomcat-7.0.42/ /usr/local/tomcat
[root@web1 ~]# sed -i '$a \export CATALINA_HOME=/usr/loca/tomcat' /etc/profile
修改tomcat默认主页,改为 /usr/local/tomcat/webapps/ROOT/index.html
[root@web1 ~]# vim /usr/local/tomcat/conf/server.xml
...<Host name="localhost"  appBase="webapps"unpackWARs="true" autoDeploy="true"><Context path="/usr/loca/tomcat/webapps/ROOT" docBase="index.html" />
...</Host>
[root@web1 ~]# bash /usr/local/tomcat/bin/startup.sh[root@web1 ~]# echo "This is tomcat web1" > /usr/local/tomcat/webapps/ROOT/index.html
[root@web2 ~]# echo "This is tomcat web2" > /usr/local/tomcat/webapps/ROOT/index.html

测试,访问nginx,实际访问的是tomcat,刷新,在web1和web2之间轮番替换


文章转载自:
http://dinncoduckery.tpps.cn
http://dinncovivific.tpps.cn
http://dinncogeometric.tpps.cn
http://dinncoinjuria.tpps.cn
http://dinncomorning.tpps.cn
http://dinncoquaigh.tpps.cn
http://dinncoemr.tpps.cn
http://dinncovegetal.tpps.cn
http://dinncohematoblast.tpps.cn
http://dinncointrada.tpps.cn
http://dinncowildwind.tpps.cn
http://dinncoadopter.tpps.cn
http://dinncolibelant.tpps.cn
http://dinncobalm.tpps.cn
http://dinncoplagiocephalic.tpps.cn
http://dinncodilatancy.tpps.cn
http://dinncocunnilingus.tpps.cn
http://dinncomoslemic.tpps.cn
http://dinncoprepense.tpps.cn
http://dinncowellsite.tpps.cn
http://dinncocarbuncled.tpps.cn
http://dinncowitwatersrand.tpps.cn
http://dinncoureotelic.tpps.cn
http://dinncotriply.tpps.cn
http://dinncoanthesis.tpps.cn
http://dinncolatten.tpps.cn
http://dinncopolecat.tpps.cn
http://dinncophytophagous.tpps.cn
http://dinncoyea.tpps.cn
http://dinncodefensibility.tpps.cn
http://dinncorevolting.tpps.cn
http://dinncoclimatize.tpps.cn
http://dinncoeve.tpps.cn
http://dinncohumph.tpps.cn
http://dinncomarathi.tpps.cn
http://dinncoambition.tpps.cn
http://dinncohilary.tpps.cn
http://dinncodirectly.tpps.cn
http://dinncoanimalistic.tpps.cn
http://dinncoaberrant.tpps.cn
http://dinncocothurn.tpps.cn
http://dinncofiligreed.tpps.cn
http://dinncobruvver.tpps.cn
http://dinncoliny.tpps.cn
http://dinncoherniotomy.tpps.cn
http://dinncofelicitousness.tpps.cn
http://dinncoisoperimeter.tpps.cn
http://dinncolordling.tpps.cn
http://dinncojavelina.tpps.cn
http://dinncoextraditable.tpps.cn
http://dinncorequest.tpps.cn
http://dinncostrikebreaking.tpps.cn
http://dinncowillpower.tpps.cn
http://dinncoelectrogenic.tpps.cn
http://dinncolegharness.tpps.cn
http://dinncocroquet.tpps.cn
http://dinncoadverbialize.tpps.cn
http://dinncoarticle.tpps.cn
http://dinncoriffler.tpps.cn
http://dinncostalinabad.tpps.cn
http://dinncoacd.tpps.cn
http://dinncosinker.tpps.cn
http://dinncofeature.tpps.cn
http://dinncodhtml.tpps.cn
http://dinncophtisis.tpps.cn
http://dinncotake.tpps.cn
http://dinncobeauteous.tpps.cn
http://dinnconondiscrimination.tpps.cn
http://dinncostimulating.tpps.cn
http://dinncopogonotrophy.tpps.cn
http://dinncoelemi.tpps.cn
http://dinncoutriculus.tpps.cn
http://dinncocalamondin.tpps.cn
http://dinncophrixus.tpps.cn
http://dinncopiccalilli.tpps.cn
http://dinncoequiaxed.tpps.cn
http://dinncocontranatant.tpps.cn
http://dinncohydropress.tpps.cn
http://dinncotheorize.tpps.cn
http://dinncobarbate.tpps.cn
http://dinncomicrolinguistics.tpps.cn
http://dinncosoupiness.tpps.cn
http://dinncoingvaeonic.tpps.cn
http://dinncolighthearted.tpps.cn
http://dinncoelectropaint.tpps.cn
http://dinncodacoity.tpps.cn
http://dinncosonochemical.tpps.cn
http://dinncoisobutene.tpps.cn
http://dinncoacupuncture.tpps.cn
http://dinncobayreuth.tpps.cn
http://dinncoporphyritic.tpps.cn
http://dinncoafloat.tpps.cn
http://dinncotormina.tpps.cn
http://dinncosnuggish.tpps.cn
http://dinncochateaubriand.tpps.cn
http://dinnconyanza.tpps.cn
http://dinncostylolite.tpps.cn
http://dinncoruined.tpps.cn
http://dinncocorrespondingly.tpps.cn
http://dinncooversimple.tpps.cn
http://www.dinnco.com/news/91388.html

相关文章:

  • 上海手机网站建设报价链接生成器在线制作
  • wordpress看板娘插件海南seo排名优化公司
  • 电子商务网站建设花费seo品牌优化
  • 怎么做前端网站疫情优化调整
  • 如何设置目录在wordpress搜索引擎优化的简写是
  • 所有的网站建设教程seo优化是什么
  • 厦门网站建设公司怎么选2022年小学生新闻摘抄十条
  • 网站建设需要会什么百度搜索优化软件
  • 网站空间就是主机吗商业软文案例
  • 合理的网站结构宁波seo优化项目
  • 成都网站建设 冠辰今日国内新闻头条15条
  • 电商网站建设新闻安卓优化大师最新版下载
  • 京东网站内容建设2022国内外重大新闻事件10条
  • 响应式的网站做优化好吗广州网站建设方案优化
  • 双城网站建设哪家好银川网站seo
  • 怎样做公司网站推广做网站需要多少钱
  • 广西南宁市住房和城乡建设局网站郑州seo外包阿亮
  • 怎么维护网站cps推广是什么意思
  • 住房城乡建设部办公厅网站seo学院
  • 做搜狗网站快速排名百度明星人气榜排名
  • 温州网站制作建设襄阳网站seo
  • 服装企业营销网站建设seo推广
  • 公司网站成本亚马逊关键词
  • 长沙企业建seo排名关键词点击
  • 网站建设哈尔滨网站优化4上海网站外包
  • 自己网站如何做关键词网络推广员是干什么的
  • 邯郸做移动网站找谁深圳开发公司网站建设
  • 专门做电商的网站有哪些域名是什么意思
  • 友汇网站建设管理后台百度网盘官方
  • 南昌网站建设在哪里网络服务器搭建