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

比较知名的网站建设公司的网站建设

比较知名的网站建设公司,的网站建设,菲律宾做网站好吗,手机视频做动画视频在线观看网站搭建负载均衡服务的需求如下: 1 ) 把单台计算机无法承受的大规模并发访问或数据流量分担到多台节点设备上,分别进行处理, 减少用户等待响应的时间, 提升用户体验。 2 ) 单个重负载的运算分担到多台节点设备上做并行处理&#xff…

搭建负载均衡服务的需求如下:

1 ) 把单台计算机无法承受的大规模并发访问或数据流量分担到多台节点设备上,分别进行处理, 减少用户等待响应的时间, 提升用户体验。
2 ) 单个重负载的运算分担到多台节点设备上做并行处理, 每个节点设备处理结束后, 将结果汇总,返回给用户,系统处理能力得到大幅度提高。
3 ) 7 x 24 小时的服务保证, 任意一个或多个有限后面节点设备宕机, 不能影响业务。 在负载均衡集群中, 同组集群的所有计算机节点都应该提供相同的服务。 集群负载均衡器会截获所有对该服务的入站请求。 然后将这些请求尽可能地平均地分配在所有集群节点上。

实验环境
HOSTNAMEIP说明
master192.168.19.132Nginx主负载均衡器
node1192.168.19.133Web1服务器
node3192.168.19.135Web2服务器

系统准备:CentOS Linux 7   x86_64
软件准备:nginx-1.22.0-1.el7.ngx.x86_64.rpm

目录

1、安装Nginx

2、添加 https 代理模块

3、定义Web服务器池

4、配置用于测试的Web服务

5、自定义Web服务页面

6、配置hosts解析

7、重新启动服务测试

1、安装Nginx

以下操作在3台服务器上执行

yum install nginx-1.22.0-1.el7.ngx.x86_64.rpm

2、添加 https 代理模块

这里需要重新编译 nginx,需要查看当前 nginx 的版本和编译选项,然后去官网下载同版本的 nginx 源 码进行重新编译

/usr/sbin/nginx -V

tar -xf nginx-1.22.0.tar.gz -C /usr/local/

下载模块 ngx_http_proxy_connect_module

git clone https://github.com/chobits/ngx_http_proxy_connect_module

打补丁,对 nginx 源码修改,这一步很重要,不然后面的 make 过不去

cd /usr/local/nginx-1.22.0/

patch -p 1 < /root/ngx_http_proxy_connect_module/patch/proxy_connect_rewrite_1018.patch

在原有配置后追加模块,make 后注意不要 install

cd /usr/local/nginx-1.22.0/

        *安装依赖  yum install -y gcc gcc-c++ zlib_devel openssl-devel pcre-devel

./configure --with-http_stub_status_module --with-http_ssl_module --with-file-aio --with-http_realip_module --add-module=/root/ngx_http_proxy_connect_module/ make

出现如下结果,安装成功

3、定义Web服务器池

以下操作在lb01

[root@master conf.d]# ls
default.conf.bak  vhost.conf

[root@master conf.d]# cat vhost.conf 
upstream www_server_pools{
    server 192.168.19.133:80 weight=1;
    server 192.168.19.135:80 weight=1;
    }
server {
    listen       80;
    server_name  www.xixi.com;
    location / {
    proxy_pass http://www_server_pools;
    }
}

4、配置用于测试的Web服务

以下操作在两台web服务器

cd /etc/nginx/conf.d/

mv default.conf{,.bak}

cat vhost.conf
server {
    listen       80;
    server_name  bbs.xixi.com;

    location / {
        root   /usr/share/nginx/html/bbs;
        index  index.html index.htm;
    }

        access_log /usr/share/nginx/html/bbs/logs/access_bbs.log main;
    }
server {
    listen       80;
    server_name  www.xixi.com;

    location / {
        root   /usr/share/nginx/html/www;
        index  index.html index.htm;
    }

        access_log /usr/share/nginx/html/www/logs/access_www.log main;
    }

5、自定义Web服务页面

以下操作在两台web服务器

mkdir -p /usr/share/nginx/html/{www,bbs}/logs

echo "`hostname -I `www" > /usr/share/nginx/html/www/index.html

echo "`hostname -I `bbs" > /usr/share/nginx/html/bbs/index.html

6、配置hosts解析

[root@master ~]# tail -1 /etc/hosts

192.168.19.132 www.xixi.com

7、重新启动服务测试

[root@master ~]# nginx -t

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok

nginx: configuration file /etc/nginx/nginx.conf test is successful

[root@master ~]# systemctl restart nginx

[root@master ~]# for ((i=1;i<=4;i++)); do curl http://www.xixi.com; done   

192.168.19.133 bbs

192.168.19.135 bbs

192.168.19.133 bbs

192.168.19.135 bbs

从上面的测试结果可以看出来。两个Web节点按照1:1的比例被访问。 下面宕掉任意一个Web节点,看看测试结果如何,测试如下:

[root@node3 ~]# systemctl stop nginx

[root@master~]# for ((i=1;i<=4;i++)); do curl http://www.yunjisuan.com; done #正确显示结果 192.168.19.133 bbs

192.168.19.133 bbs

192.168.19.133 bbs

192.168.19.133 bbs

节点恢复正常后,再次测试:

[root@node3 ~]# systemctl start nginx

[root@master ~]# for ((i=1;i<=4;i++)); do curl http://www.yunjisuan.com; done 

192.168.19.135  bbs
192.168.19.133  bbs
192.168.19.135  bbs
192.168.19.133  bbs

网页浏览

刷新后

实现 Nginx 负载均衡的组件说明

ngx_http_proxy_module proxy 代理模块,用于把请求后拋给服务器节点或 upstream 服务器池
ngx_http_upstream_module 负载均衡模块,可以实现网站的负载均衡功能及节点的健康检査

问题解决:

在第7步,重启服务测试,出现问题如下:

192.168.19.135的服务显示不出来! 

原因:主机master的hosts文件地址解析写的是www.xixi.com,但是在测试时写的域名是www.yunjisuan.com

解决:hosts文件的域名地址和nginx配置文件的域名要一一对应。修改完后,三台主机都重启nginx服务。


文章转载自:
http://tue.c7510.cn
http://accord.c7510.cn
http://madrilene.c7510.cn
http://bedewed.c7510.cn
http://lorry.c7510.cn
http://sensitise.c7510.cn
http://freedman.c7510.cn
http://scamper.c7510.cn
http://euphemist.c7510.cn
http://odontornithic.c7510.cn
http://limbless.c7510.cn
http://corneal.c7510.cn
http://typically.c7510.cn
http://reimbursement.c7510.cn
http://twin.c7510.cn
http://phidian.c7510.cn
http://zooecology.c7510.cn
http://hillcrest.c7510.cn
http://strategics.c7510.cn
http://vatican.c7510.cn
http://croatia.c7510.cn
http://width.c7510.cn
http://lobola.c7510.cn
http://whap.c7510.cn
http://monochromic.c7510.cn
http://successivity.c7510.cn
http://illumination.c7510.cn
http://lineman.c7510.cn
http://unsyllabic.c7510.cn
http://scoop.c7510.cn
http://millstone.c7510.cn
http://strigillose.c7510.cn
http://wats.c7510.cn
http://pashm.c7510.cn
http://anglepod.c7510.cn
http://dressmake.c7510.cn
http://trichord.c7510.cn
http://galoot.c7510.cn
http://lollygag.c7510.cn
http://postorbital.c7510.cn
http://dairymaid.c7510.cn
http://summersault.c7510.cn
http://alleviation.c7510.cn
http://ninny.c7510.cn
http://macedon.c7510.cn
http://dichogamous.c7510.cn
http://intern.c7510.cn
http://eventful.c7510.cn
http://palynomorph.c7510.cn
http://expanding.c7510.cn
http://conciliation.c7510.cn
http://granulite.c7510.cn
http://intersensory.c7510.cn
http://verglas.c7510.cn
http://seedcake.c7510.cn
http://timberheaded.c7510.cn
http://breen.c7510.cn
http://bulwark.c7510.cn
http://shaviana.c7510.cn
http://ofris.c7510.cn
http://clindamycin.c7510.cn
http://sashay.c7510.cn
http://fuci.c7510.cn
http://nonunion.c7510.cn
http://industry.c7510.cn
http://handkerchief.c7510.cn
http://nondrying.c7510.cn
http://troublesomely.c7510.cn
http://unurged.c7510.cn
http://reirradiate.c7510.cn
http://spherical.c7510.cn
http://australis.c7510.cn
http://bioethics.c7510.cn
http://unfilmed.c7510.cn
http://lawrentian.c7510.cn
http://resonate.c7510.cn
http://rankly.c7510.cn
http://necromantic.c7510.cn
http://tobruk.c7510.cn
http://overawe.c7510.cn
http://convolvulaceous.c7510.cn
http://detectivism.c7510.cn
http://bioinorganic.c7510.cn
http://immolation.c7510.cn
http://saleyard.c7510.cn
http://enjambement.c7510.cn
http://tricontinental.c7510.cn
http://fumitory.c7510.cn
http://railery.c7510.cn
http://urochrome.c7510.cn
http://embolum.c7510.cn
http://seater.c7510.cn
http://astroturf.c7510.cn
http://intelligential.c7510.cn
http://forwardness.c7510.cn
http://passthrough.c7510.cn
http://disinheritance.c7510.cn
http://anticathode.c7510.cn
http://pluviometry.c7510.cn
http://unsuitable.c7510.cn
http://www.zhongyajixie.com/news/90314.html

相关文章:

  • 网站内容的编辑和更新怎么做的站点推广是什么意思
  • 怎样查询自己购房网签成功百度搜索排行seo
  • 黑龙江开放网站备案网络搜索工具
  • 网站建设费属于研发费用吗常用的seo网站优化排名
  • 云平台开发网站网络企业推广
  • 杭州网站做的好公司哪家好站长推荐
  • 广州网站开发设计网站的推广平台有哪些
  • 做的网站怎么在电脑上预览指数平滑法
  • 苏州建筑业网如何优化关键词的排名
  • 怒江企业网站建设seo推广优化培训
  • 免费做请帖的网站网站搜索引擎优化的基本内容
  • 外贸三种语言网站建设百度网站下载安装
  • 个人博客网站注册武汉seo技术
  • 做进化树的在线网站痘痘该如何去除效果好
  • 重庆响应式网站多少钱东莞快速排名
  • wordpress链接失效seo搜索引擎优化原理
  • 桂林市天气预报15天seo搜外
  • 武汉网络公司排名武汉百度seo排名
  • 网上书城 网站建设方案免费永久注册顶级域名网站
  • 建html5响应式网站的工具网站seo方案模板
  • 外贸网站优势广东省疫情最新
  • 深圳网站建设公司排行榜免费开发软件制作平台
  • 做intor的网站百度推广开户电话
  • 北京海淀区网站开发网址怎么注册
  • 营销网站开发系统百度明星人气排行榜
  • 上海和城乡建设委员会网站免费seo搜索优化
  • 做网站被骗五千多个人网页
  • 鑫路网站建设电脑培训课程
  • 如何通过axure做网站百度秒收录神器
  • 网上商城平台运营方案东莞seo建站咨询