vim haproxy.cfg
#---------------------------------------------------------------------
# Example configuration for a possible web application. See the
# full configuration options online.
#
# http://haproxy.1wt.eu/download/1.4/doc/configuration.txt
#
#---------------------------------------------------------------------
#---------------------------------------------------------------------
# Global settings
#---------------------------------------------------------------------
global
# to have these messages end up in /var/log/haproxy.log you will
# need to:
#
# 1) configure syslog to accept network log events. This is done
# by adding the '-r' option to the SYSLOGD_OPTIONS in
# /etc/sysconfig/syslog
#
# 2) configure local2 events to go to the /var/log/haproxy.log
# file. A line like the following can be added to
# /etc/sysconfig/syslog
#
# local2.* /var/log/haproxy.log
#
log 127.0.0.1 local2
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 4000
user haproxy
group haproxy
daemon
# turn on stats unix socket
stats socket /var/lib/haproxy/stats
#---------------------------------------------------------------------
# common defaults that all the 'listen' and 'backend' sections will
# use if not designated in their block
#---------------------------------------------------------------------
defaults
mode http
log global
option httplog
option dontlognull
option http-server-close
option forwardfor except 127.0.0.0/8
option redispatch
retries 3
timeout http-request 10s
timeout queue 1m
timeout connect 10s
timeout client 1m
timeout server 1m
timeout http-keep-alive 10s
timeout check 10s
maxconn 3000
#---------------------------------------------------------------------
# main frontend which proxys to the backends
#---------------------------------------------------------------------
frontend main
bind *:80
acl web hdr(host) -i www.137fc.com #當訪問的是這個網(wǎng)址的時候
use_backend webserver if web #讓ACL web使用webserver規(guī)則
#---------------------------------------------------------------------
# static backend for serving up images, stylesheets and such
#---------------------------------------------------------------------
backend webserver #定義webserver規(guī)則
balance source
server web1 10.10.10.115:80 cookie 1 weight 5 check inter 2000 rise 2 fall 3
server web2 10.10.10.120:80 cookie 1 weight 5 check inter 2000 rise 2 fall 3
#---------------------------------------------------------------------
# round robin balancing between the various backends
#---------------------------------------------------------------------
Haproxy基本配置文件
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
- 文/潘曉璐 我一進店門绞蹦,熙熙樓的掌柜王于貴愁眉苦臉地迎上來力奋,“玉大人,你說我怎么就攤上這事幽七【耙螅” “怎么了?”我有些...
- 文/不壞的土叔 我叫張陵澡屡,是天一觀的道長猿挚。 經(jīng)常有香客問我,道長驶鹉,這世上最難降的妖魔是什么绩蜻? 我笑而不...
- 正文 為了忘掉前任,我火速辦了婚禮室埋,結(jié)果婚禮上办绝,老公的妹妹穿的比我還像新娘伊约。我一直安慰自己,他們只是感情好孕蝉,可當我...
- 文/花漫 我一把揭開白布屡律。 她就那樣靜靜地躺著,像睡著了一般降淮。 火紅的嫁衣襯著肌膚如雪超埋。 梳的紋絲不亂的頭發(fā)上,一...
- 文/蒼蘭香墨 我猛地睜開眼巾腕,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了絮蒿?” 一聲冷哼從身側(cè)響起,我...
- 正文 年R本政府宣布焦辅,位于F島的核電站,受9級特大地震影響椿胯,放射性物質(zhì)發(fā)生泄漏筷登。R本人自食惡果不足惜,卻給世界環(huán)境...
- 文/蒙蒙 一哩盲、第九天 我趴在偏房一處隱蔽的房頂上張望前方。 院中可真熱鬧狈醉,春花似錦、人聲如沸惠险。這莊子的主人今日做“春日...
- 文/蒼蘭香墨 我抬頭看了看天上的太陽莺匠。三九已至金吗,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間趣竣,已是汗流浹背摇庙。 一陣腳步聲響...
推薦閱讀更多精彩內(nèi)容
- 配置項目基本信息 新建項目 勾選上下面兩項的意思是:1.導入測試框架2.導入UI框架 應用程序配置 圖片素材 1....
- 1.主項目中的.gitignore文件 app模塊下的.gitignore文件 通過上面的配置git提交的時候就會...
- 本文將介紹平常android開發(fā)當中項目module的gradle文件中的基本配置(不包含創(chuàng)建的library進行...