<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                注意:在默認配置段的參數,有些在frontend,backend,listen段中也可以配置,如果在這些都配置了,該值會覆蓋defaults段的 ~~~ defaults log global #引入global定義的日志格式 mode http #所處理的類別(7層代理http,4層代理tcp) maxconn 50000 #最大連接數 option httplog #日志類別為http日志格式 option httpclose #每次請求完畢后主動關閉http通道 option dontlognull #不記錄健康檢查日志信息 option forwardfor #如果后端服務器需要獲得客戶端的真實ip,需要配置的參數, 可以從http header 中獲取客戶端的IP retries 3 #3次連接失敗就認為服務器不可用,也可以通過后面設置 option redispatch #《---上述選項意思是指serverID 對應的服務器掛掉后,強制定向到其他健康的服務器, 當使用了 cookie時, haproxy將會將其請求的后端服務器的serverID插入到cookie中,以保證會話的SESSION持久性;而此時,如果 后端的服務器宕掉了,但是客戶端的cookie是不會刷新的,如果設置此參數,將會將客戶的請求強制定向到另外一個 后端server上,以保證服務的正常---》 stats refresh 30 #設置統計頁面刷新時間間隔 option abortonclose #當服務器負載很高的時候,自動結束掉當前隊列處理比較久的連接 timeout http-request 10s #默認http請求超時時間 timeout queue 1m #默認隊列超時時間 timeout connect 10s #默認連接超時時間 timeout client 1m #默認客戶端超時時間 timeout server 1m #默認服務器超時時間 timeout http-keep-alive 10s #默認持久連接超時時間 timeout check 10s #設置心跳檢查超時時間 errorfile 403 /etc/haproxy/errorfiles/403.http errorfile 404 /etc/haproxy/errorfiles/404.http errorfile 500 /etc/haproxy/errorfiles/500.http errorfile 502 /etc/haproxy/errorfiles/502.http errorfile 503 /etc/haproxy/errorfiles/503.http errorfile 504 /etc/haproxy/errorfiles/504.http ~~~ 說明: 1、mode http 設置haproxy的運行模式 注意:如果haproxy是用來代理四層(比如mysql),這里就要使用 mode tcp tcp模式:在此模式下,客戶端和服務器端之前將建立一個全雙工的連接,不會對七層報文做任何檢查,默認為tcp模式,經常用于SSL、SSH、SMTP等應用。 http模式:在此模式下,客戶端請求在轉發至后端服務器之前將會被深度分板,所有不與RFC格式兼容的請求都會被拒絕。 health:已基本不用了。 2、log global 設置日志繼承全局配置段的設置 3、option httplog 表示打開記錄http請求的日志功能 4、option dontlognull 如果產生了一個空連接,那這個空連接的日志將不會記錄 5、option http-server-close 打開http協議中服務器端關閉功能,使得支持長連接,使得會話可以被重用 6、option forwardfor except 127.0.0.1/8 如果上游服務器上的應用程序想記錄客戶端的真實IP地址,haproxy會把客戶端的IP信息發送給上游服務器,在HTTP請求中添加”X-Forwarded-For”字段,但當是haproxy自身的健康檢測機制去訪問上游服務器時是不應該把這樣的訪問日志記錄到日志中的,所以用except來排除127.0.0.0,即haproxy自身 7、option redispatch 當與上游服務器的會話失敗(服務器故障或其他原因),把會話重新分發到其他健康的服務器上,當原來故障的服務器恢復,會話又被定向到已恢復的服務器上 8、retries 3 向上游服務器嘗試連接的最大次數,超過此值就認為后端服務器不可用 9、option abortonclose 當haproxy負載很高時,自動結束掉當前隊列處理比較久的連接 10、timeout http-requests 10s 客戶端發送http請求的超時時間 11、timeout queue 1m 當上游服務器在高負載響應haproxy時,會把haproxy發送來的請求放進一個隊列中,timeout queue定義放入這個隊列的超時時間 12、timeout connect 5s haproxy 與 后端服務器連接超時時間,如果在同一個局域網可設置較小的時間 13、timeout client 1m 定義客戶端和haproxy連接,非活動連接的超時時間 14、timeout server 1m 定義haproxy與上游服務器非活動連接的超時時間 15、timeout http-keep-alive 10s 定義新的http請求連接建立的最大超時時間(持久連接,多長時間不活動,就釋放) 16、timeout check 10s 健康檢測的最大超時時間 17 maxconn 最大并發連接數 18 spread-check 《0-50,in percent》 在haproxy后端有眾多服務器的場景中,在精確的時間間隔后統一對眾服務器進行健康檢查可能會帶來意外問題。此選項用于將其檢查的時間間隔長度上增加或減少一定的隨機時長 19、compression 開啟HTTP壓縮功能 compression algo gzip #compression offload compression type text/html text/plain text/css application/javascript application/json application/xml application/x-shockwave-flash application/pdf 20 errorfile 當客戶訪問一個不存在的頁面或者服務器端響應錯誤,haproxy會根據不同的響應碼回應不同的頁面,這些頁面可以根據公司業務,提交定制 案例: errorfile 403 /etc/haproxy/errorfiles/403.http errorfile 404 /etc/haproxy/errorfiles/404.http errorfile 500 /etc/haproxy/errorfiles/500.http errorfile 502 /etc/haproxy/errorfiles/502.http errorfile 503 /etc/haproxy/errorfiles/503.http errorfile 504 /etc/haproxy/errorfiles/504.http
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看