中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當(dāng)前位置: 首頁(yè) > news >正文

公司變更股權(quán)怎么辦理北京廈門網(wǎng)站優(yōu)化

公司變更股權(quán)怎么辦理,北京廈門網(wǎng)站優(yōu)化,為什么網(wǎng)站上傳都上傳不成功,萬(wàn)界隨機(jī)購(gòu)物系統(tǒng)目錄 Haproxy概述 haproxy算法: Haproxy實(shí)現(xiàn)七層負(fù)載 ①部署nginx-server測(cè)試頁(yè)面 ②(主/備)部署負(fù)載均衡器 ③部署keepalived高可用 ④增加對(duì)haproxy健康檢查 ⑤測(cè)試 Haproxy概述 haproxy---主要是做負(fù)載均衡的7層,也可以做4層負(fù)載均衡 apache也可…

目錄

Haproxy概述

haproxy算法:

Haproxy實(shí)現(xiàn)七層負(fù)載

①部署nginx-server測(cè)試頁(yè)面

②(主/備)部署負(fù)載均衡器

?③部署keepalived高可用

?④增加對(duì)haproxy健康檢查

⑤測(cè)試


Haproxy概述

haproxy---主要是做負(fù)載均衡的7層,也可以做4層負(fù)載均衡
apache也可以做7層負(fù)載均衡,但是很麻煩。實(shí)際工作中沒有人用。
負(fù)載均衡是通過OSI協(xié)議對(duì)應(yīng)的
7層負(fù)載均衡:用的7層http協(xié)議,
4層負(fù)載均衡:用的是tcp協(xié)議加端口號(hào)做的負(fù)載均衡

haproxy算法:


1.roundrobin
基于權(quán)重進(jìn)行輪詢,在服務(wù)器的處理時(shí)間保持均勻分布時(shí),這是最平衡,最公平的算法.此算法是動(dòng)態(tài)的,這表示其權(quán)重可以在運(yùn)行時(shí)進(jìn)行調(diào)整.不過在設(shè)計(jì)上,每個(gè)后端服務(wù)器僅能最多接受4128個(gè)連接
2.static-rr
基于權(quán)重進(jìn)行輪詢,與roundrobin類似,但是為靜態(tài)方法,在運(yùn)行時(shí)調(diào)整其服務(wù)器權(quán)重不會(huì)生效.不過,其在后端服務(wù)器連接數(shù)上沒有限制
3.leastconn
新的連接請(qǐng)求被派發(fā)至具有最少連接數(shù)目的后端服務(wù)器.

Haproxy實(shí)現(xiàn)七層負(fù)載

keepalived+haproxy

192.168.134.165? master

192.168.134.166 slave

192.168.134.163? nginx-server

192.168.134.164 nginx-server

192.168.134.160? ?VIP(虛擬IP)

①部署nginx-server測(cè)試頁(yè)面

兩臺(tái)nginx都部署方便測(cè)試

[root@server03 ~]# yum -y install nginx
[root@server03 ~]# systemctl  start nginx
[root@server03 ~]# echo "webserver01..." > /usr/share/nginx/html/index.html [root@server04 ~]# yum -y install nginx
[root@server04 ~]# systemctl  start nginx
[root@server04 ~]# echo "webserver02..." > /usr/share/nginx/html/index.html
②(主/備)部署負(fù)載均衡器
[root@server01 ~]# yum -y install haproxy
[root@server01 ~]# vim /etc/haproxy/haproxy.cfg
globallog         127.0.0.1 local2 infopidfile     /var/run/haproxy.pidmaxconn     4000user        haproxygroup       haproxydaemonnbproc 1
defaultsmode                    httplog                     globalretries                 3option                  redispatchmaxconn                 4000contimeout              5000clitimeout              50000srvtimeout              50000
listen statsbind                        *:81stats                       enablestats uri                   /haproxystats auth                  aren:123
frontend  webmode                        httpbind                            *:80option                  httplogacl html url_reg  -i  \.html$use_backend httpservers if  htmldefault_backend    httpservers
backend httpserversbalance     roundrobinserver  http1 192.168.134.163:80 maxconn 2000 weight 1  check inter 1s rise 2 fall 2server  http2 192.168.134.164:80 maxconn 2000 weight 1  check inter 1s rise 2 fall 2[root@server01 ~]# systemctl  start haproxy

瀏覽器訪問haproxy監(jiān)控

master:

slave:

頁(yè)面主要參數(shù)解釋
Queue
Cur: current queued requests //當(dāng)前的隊(duì)列請(qǐng)求數(shù)量
Max:max queued requests ????//最大的隊(duì)列請(qǐng)求數(shù)量
Limit: ??????????//隊(duì)列限制數(shù)量

Errors
Req:request errors ????????????//錯(cuò)誤請(qǐng)求
Conn:connection errors ?????????//錯(cuò)誤的連接

Server列表:
Status:狀態(tài),包括up(后端機(jī)活動(dòng))和down(后端機(jī)掛掉)兩種狀態(tài)
LastChk: ???持續(xù)檢查后端服務(wù)器的時(shí)間
Wght: (weight) : 權(quán)重

?③部署keepalived高可用

注意:master和slave的優(yōu)先級(jí)不一樣,但虛擬路由id(virtual_router_id)保持一致;并且slave配置?nopreempt(不搶占資源)

master:

[root@server01 ~]# yum -y install keepalived
[root@server01 ~]# vim /etc/keepalived/keepalived.conf 
! Configuration File for keepalivedglobal_defs {router_id director1
}
vrrp_instance VI_1 {state MASTERinterface ens33virtual_router_id 80priority 100advert_int 1authentication {auth_type PASSauth_pass 1111}virtual_ipaddress {192.168.134.160/24}
}[root@server01 ~]# systemctl  start keepalived

slaver:

[root@localhost ~]# yum -y install keepalived
[root@localhost ~]# vim /etc/keepalived/keepalived.conf
! Configuration File for keepalivedglobal_defs {router_id directory2
}
vrrp_instance VI_1 {state BACKUPinterface ens33nopreemptvirtual_router_id 80priority 50advert_int 1authentication {auth_type PASSauth_pass 1111}virtual_ipaddress {192.168.134.160/24}
}
[root@localhost ~]# systemctl  start keepalived

查看IP

?④增加對(duì)haproxy健康檢查

兩臺(tái)機(jī)器都做,讓Keepalived以一定時(shí)間間隔執(zhí)行一個(gè)外部腳本,腳本的功能是當(dāng)Haproxy失敗,則關(guān)閉本機(jī)的Keepalived。

[root@server01 ~]# vim /etc/keepalived/check.sh
#!/bin/bash /usr/bin/curl -I http://localhost &>/dev/null
if [ $? -ne 0 ];then
#       /etc/init.d/keepalived stopsystemctl stop keepalived
fi
[root@server01 ~]# chmod a+x /etc/keepalived/check.sh

在keepalived增加健康檢查配置vrrp_script check_haproxy并且用?track_script調(diào)用。

! Configuration File for keepalivedglobal_defs {router_id director1
}
vrrp_script check_haproxy {script "/etc/keepalived/check.sh"interval 5
}
vrrp_instance VI_1 {state MASTERinterface ens33virtual_router_id 80priority 100advert_int 1authentication {auth_type PASSauth_pass 1111}virtual_ipaddress {192.168.134.160/24}track_script {check_haproxy}
}

重啟keepalived

[root@server01 ~]# systemctl  restart keepalived
⑤測(cè)試

關(guān)閉master的haproxy服務(wù)可以發(fā)現(xiàn)master的keepalived服務(wù)也關(guān)閉,此時(shí)master上的VIP轉(zhuǎn)移到slave上

  • 關(guān)閉master的服務(wù)并查看VIP

  • 查看slave的IP可以發(fā)現(xiàn)VIP跳轉(zhuǎn)至此。

  • 在web界面查看服務(wù)是否正常

第一次刷新

第二次刷新

http://www.risenshineclean.com/news/5917.html

相關(guān)文章:

  • tab導(dǎo)航 wordpressseo托管服務(wù)
  • wordpress .seo怎樣
  • 網(wǎng)站建設(shè)工具 hbuild互聯(lián)網(wǎng)營(yíng)銷師題庫(kù)
  • 網(wǎng)站平面設(shè)計(jì)培訓(xùn)百度網(wǎng)站提交入口網(wǎng)址
  • 湖北中英雙語(yǔ)網(wǎng)站建設(shè)seo優(yōu)化公司
  • 制作免費(fèi)網(wǎng)站的平臺(tái)百度快照有什么用
  • 網(wǎng)站設(shè)置訪問密碼達(dá)內(nèi)教育
  • 美塔基500元做網(wǎng)站可信嗎如何做網(wǎng)站
  • 做任務(wù)什么網(wǎng)站賀州seo
  • 今日中國(guó)疫情最新消息數(shù)據(jù)平板電視seo優(yōu)化關(guān)鍵詞
  • 用戶界面設(shè)計(jì)包括seo培訓(xùn)機(jī)構(gòu)排名
  • 網(wǎng)絡(luò)服務(wù)商英文seo優(yōu)化網(wǎng)站優(yōu)化排名
  • 杭州高端網(wǎng)站網(wǎng)站seo排名免費(fèi)咨詢
  • 山東建設(shè)網(wǎng)站首頁(yè)建網(wǎng)站多少錢
  • 深圳網(wǎng)站開發(fā)公司寶網(wǎng)seo外包優(yōu)化公司
  • 網(wǎng)站 意義百度查重入口
  • 汽車網(wǎng)站頁(yè)面設(shè)計(jì)雅虎搜索引擎中文版
  • 浙江省人才網(wǎng)官方網(wǎng)站建設(shè)廳招聘企業(yè)網(wǎng)站有哪些功能
  • wordpress顯示慢網(wǎng)站推廣seo設(shè)置
  • 公司做網(wǎng)站設(shè)計(jì)的百度熱點(diǎn)排行榜
  • 網(wǎng)站升級(jí)中模板站長(zhǎng)統(tǒng)計(jì)幸福寶
  • 怎樣修改網(wǎng)站模板百度seo網(wǎng)站優(yōu)化 網(wǎng)絡(luò)服務(wù)
  • 赤峰專業(yè)的網(wǎng)站建設(shè)谷歌搜索引擎優(yōu)化
  • 哪個(gè)網(wǎng)站可以做付郵免費(fèi)送活動(dòng)怎么免費(fèi)自己做推廣
  • 做詐騙網(wǎng)站犯什么法西安百度公司地址介紹
  • 煙臺(tái)網(wǎng)站改版網(wǎng)站快速收錄
  • 新手去哪個(gè)網(wǎng)站做翻譯搜索引擎哪個(gè)最好用
  • 餐飲網(wǎng)站建設(shè)百度com百度一下你
  • 平安好車主app下載官方網(wǎng)站下載推廣拉新app哪幾個(gè)靠譜
  • 做涉黃的視頻網(wǎng)站用什么服務(wù)器域名注冊(cè)需要多少錢