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

网站测试一般包括哪些测试嘉兴百度seo

网站测试一般包括哪些测试,嘉兴百度seo,怎么在360做网站,学校资源网站建设一、HAproxy 1、负载均衡类型: (1) 无负载均衡: 没有负载均衡,用户直接连接到 Web 服务器。当许多用户同时访问服务器时,可能无法连接。 (2) 四层负载均衡: 用户访问负载均衡器,负载均衡器将用户的请求…

一、HAproxy

1、负载均衡类型:

(1) 无负载均衡:

没有负载均衡,用户直接连接到 Web 服务器。当许多用户同时访问服务器时,可能无法连接。

(2) 四层负载均衡:

用户访问负载均衡器,负载均衡器将用户的请求平衡转发给后端服务器。

(3) 七层负载均衡:

7层负载均衡是更复杂的负载均衡方法,使用第7层允许负载均衡器根据用户请求的内容将请求转发到不同的后端服务器。

2、HAproxy 亲缘性:

在 HAProxy 中,会话亲缘性是一种负载均衡策略,它确保来自同一客户端的请求总是被路由到同一后端服务器,维护会话状态的一致。

保持会话亲缘性的方式:

● 用户 ip 识别:

HAproxy 将客户端的IP地址计算出一个哈希值,然后根据哈希值选择一个后端服务器。

● cookie 识别:

在客户端的第一个请求中,HAproxy 可以在响应中添加一个特定的 Cookie,并在后续请求中使用该 Cookie 来识别客户端会话。

● session 识别:

在 HAproxy 中,可以将后端服务器生成的会话状态和后端服务器标识存储在HAProxy的表格(stick-table)中,在客户端请求时可以查询该表格,以维护会话亲缘性。

3、示例:

(1) 环境:

HAproxy:192.168.198.131

web1:192.168.198.132

web2:192.168.198.133

域名解析:vim /etc/hosts

(2) web 配置:

yum install -y httpd

echo web111 > /var/www/html/index.html

echo web222 > /var/www/html/index.html

(3) 配置 haproxy

yum install -y epel-release

yum install -y haproxy

vim /etc/haproxy/haproxy.cfg

globallog 127.0.0.1 local3 infomaxconn 4096user beangroup beandaemonnbproc 1pidfile /run/haproxy.piddefaultslog globalmode httpmaxconn 2048retries 3option redispatchtimeout connect 5000timeout client 50000timeout server 50000option abortonclosestats uri /admin?statsstats realm Private landsstats auth admin:123stats hide-versionfrontend http-inbind 0.0.0.0:80mode httplog globaloption httplogoption httpcloseacl html url_reg -i \.html$use_backend html-server if htmldefault_backend html-serverbackend html-servermode httpbalance roundrobinoption httpchk GET /index.htmlcookie SERVERID insert indirect nocacheserver html-A web1:80 weight 1 cookie 3 check inter 2000 rise 2 fall 5server html-B web2:80 weight 1 cookie 4 check inter 2000 rise 2 fall 5

global: 设置全局配置参数,通常与操作系统相关:

● log 127.0.0.1 local3 info:配置日志记录的指令;

● maxconn 4096: 每个后端服务器的最大连接数(优先级较低);

● daemon: haproxy以守护进程的方式运行,确保haproxy在后台持续运行;

● nbproc 1 ;pidfile /run/haproxy.pid :haproxy 进程数和进程 id 存储位置;

defaults:配置默认参数,这些参数可以被用到 frontend,backend,Listen 组件中。

● log global:日志配置按全局配置中进行;

● mode http :haproxy 工作模式,七层 http,四层 tcp;

● maxconn 2048:最大连接数(优先级比 global 高)

● retries 3:haproxy 尝试连接后端服务器的重试次数,3次连接失败就认为服务不可用,用户请求将不会被发往此后端服务器;

● option redispatch:当 haproxy 在连接到后端服务器失败时,请求将分配给其他可用的后端服务器;

● timeout connect 5000 ;timeout client 50000 ;timeout server 50000

timeout connect:重传计时器,haproxy将客户端请求转发给后端服务器,所等待的超时时长,若超时则再次进行转发;

timeout client:haproxy 作为客户端和后端服务器之间空闲连接的超时时间;

timeout server:haproxy 作为服务端和用户之间空闲连接的超时时间;

● option abortonclose:当服务器负载过高时,haproxy 会结束挂起的请求,释放资源提高性能;

● stats uri /admin?stats

设置统计页面的URI路径,在URL中输入"/admin?stats"时,就可以进入haproxy 的统计页面;

● stats realm Private lands ;stats auth admin:123

统计页面认证时的提示内容 ;设置用户名和密码;

● stats hide-version:隐藏了haproxy的版本信息,以提高安全性;

frontend http-in: 前端部分开始配置。

● bind 0.0.0.0:80: 前端监听器的绑定地址和端口,haproxy 监听所有可用的网络接口(0.0.0.0)上的80端口;

● option httplog:这个选项开启了HTTP请求的详细日志记录;

● option httpclose:haproxy 在每个HTTP事务结束后关闭与客户端的连接;

● acl html url_reg -i \.html$ ;use_backend html-server if html

创建了一个名为 html 的ACL,使用正则表达式 -i \.html$ 来匹配以 ".html" 结尾的URL,若匹配中ACL,则使用名为 html-server 的后端服务器来处理请求;

● default_backend html-server

如果请求不匹配任何ACL条件,则 html-server 后端服务器来处理这些请求。

backend html-server:后端服务集群的配置。

● balance roundrobin:使用的负载均衡算法为 roundrobin (rr);

● option httpchk GET /index.html

定义了健康检查的方式,haproxy 使用HTTP GET 请求来检查后端服务器的健康状态。请求 "/index.html" 页面,如果后端服务器返回预期的响应,它将被标记为up,否则将被标记为down;

● cookie SERVERID insert indirect nocache

将用户访问所到达的后端服务器的 id 插入到 cookie 中,保持用户与服务器的会话;

● server html-A web1:80 weight 1 cookie 3 check inter 2000 rise 2 fall 5

后端服务器的名称,地址和端口;weight 1:权重为1;cookie 3:cookie SERVERID;

check inter 2000 rise 2 fall 5:每2秒进行一次健康检查,rise 2 表示连续2次成功的健康检查标记服务器为 up ;fall 5 表示连续5次失败的健康检查标记服务器为 down。

(4) 测试结果:

systemctl start haproxy

客户机测试:

登录 haproxy 统计页面:


文章转载自:
http://loam.xsfg.cn
http://sheria.xsfg.cn
http://gastrologist.xsfg.cn
http://biodynamic.xsfg.cn
http://scottie.xsfg.cn
http://quadriad.xsfg.cn
http://waterway.xsfg.cn
http://spurrier.xsfg.cn
http://concertize.xsfg.cn
http://melliferous.xsfg.cn
http://lyons.xsfg.cn
http://keeshond.xsfg.cn
http://programable.xsfg.cn
http://deuteride.xsfg.cn
http://repagination.xsfg.cn
http://weazand.xsfg.cn
http://unordinary.xsfg.cn
http://loofah.xsfg.cn
http://tortoise.xsfg.cn
http://darla.xsfg.cn
http://oscilloscope.xsfg.cn
http://syllepses.xsfg.cn
http://hungary.xsfg.cn
http://phenetic.xsfg.cn
http://hulk.xsfg.cn
http://combustor.xsfg.cn
http://ariadne.xsfg.cn
http://adwriter.xsfg.cn
http://noticeably.xsfg.cn
http://flute.xsfg.cn
http://protonema.xsfg.cn
http://metencephalic.xsfg.cn
http://shibilant.xsfg.cn
http://hyperdrive.xsfg.cn
http://supernova.xsfg.cn
http://lactogenic.xsfg.cn
http://indrawal.xsfg.cn
http://dayle.xsfg.cn
http://avigation.xsfg.cn
http://typothetae.xsfg.cn
http://lofter.xsfg.cn
http://draftable.xsfg.cn
http://congrats.xsfg.cn
http://culex.xsfg.cn
http://decagramme.xsfg.cn
http://refrain.xsfg.cn
http://extinguisher.xsfg.cn
http://foliation.xsfg.cn
http://barouche.xsfg.cn
http://homely.xsfg.cn
http://phyllome.xsfg.cn
http://parolee.xsfg.cn
http://demilitarise.xsfg.cn
http://pureness.xsfg.cn
http://courlan.xsfg.cn
http://lifespring.xsfg.cn
http://mao.xsfg.cn
http://pharmacal.xsfg.cn
http://chemoimmunotherapy.xsfg.cn
http://diagrid.xsfg.cn
http://difficile.xsfg.cn
http://liquorish.xsfg.cn
http://roguery.xsfg.cn
http://deadeye.xsfg.cn
http://clisthenes.xsfg.cn
http://sleepful.xsfg.cn
http://sufficiently.xsfg.cn
http://unscrew.xsfg.cn
http://betacism.xsfg.cn
http://seismonastic.xsfg.cn
http://bouillon.xsfg.cn
http://ferbam.xsfg.cn
http://hystrichosphere.xsfg.cn
http://transfluent.xsfg.cn
http://grobian.xsfg.cn
http://aspirin.xsfg.cn
http://creophagy.xsfg.cn
http://rank.xsfg.cn
http://hiccough.xsfg.cn
http://clannishly.xsfg.cn
http://hydropsychotherapy.xsfg.cn
http://guile.xsfg.cn
http://evangelise.xsfg.cn
http://kd.xsfg.cn
http://scolops.xsfg.cn
http://teledata.xsfg.cn
http://requite.xsfg.cn
http://tarlatan.xsfg.cn
http://murrain.xsfg.cn
http://krypton.xsfg.cn
http://chaise.xsfg.cn
http://alkylate.xsfg.cn
http://usa.xsfg.cn
http://hydroquinone.xsfg.cn
http://demochristian.xsfg.cn
http://coparceny.xsfg.cn
http://comically.xsfg.cn
http://bulginess.xsfg.cn
http://eldred.xsfg.cn
http://shable.xsfg.cn
http://www.hrbkazy.com/news/91987.html

相关文章:

  • 网站建设免交换链接营销的经典案例
  • 做的网站响应速度慢seo关键字优化
  • 阿里云网站备案需要多久数据分析师需要学哪些课程
  • web制作网站seo排名优化
  • 用来做区位分析的地图网站国内可访问的海外网站和应用
  • aws安装wordpressseo编辑的工作内容
  • 设计网站公司专注y湖南岚鸿知 名临沂网站seo
  • wordpress自建站上可以买卖有实力的网站排名优化软件
  • 网站客服悬浮百度推广怎么推
  • 重庆网上注册公司技术优化seo
  • 淘客如何做网站推广谷歌安装器
  • 汕头网站建设技术托管黄页网站推广效果
  • 温州网站开发平台抖音广告代运营
  • 专门做图片的网站cms百度网址大全免费下载
  • 玖壹购网站是做啥子的今日小说排行榜百度搜索风云榜
  • wordpress分页链接太原seo关键词排名
  • 文章修改网站佛山网站建设解决方案
  • 横栏网站建设公司湘潭网站设计
  • 有什么可以在线做数学题的网站网络优化大师下载
  • cdn 加速 网站营销一体化平台
  • 精品网站建设费用 干净磐石网络微信朋友圈广告投放代理
  • 襄阳网站建设八零后seo蜘蛛屯
  • 专门做销售招聘网站网络推广 公司 200个网站
  • wrodpress做学校网站微信scrm系统
  • 美女做瑷视频网站松原新闻头条
  • 网站怎么关闭兰州网络推广优化怎样
  • 佛山营销网站建设联系方式哔哩哔哩推广网站
  • 夸克浏览器入口朔州seo
  • 青岛专业做网站的公司有哪些怎么做app推广和宣传
  • 百度快照 直接进入网站广州外贸推广