生产环境中架构用到IIS+haproxy+keepalived+nginx的综合介绍
下文给大家带来生产环境中架构用到IIS+haproxy+keepalived+nginx的综合介绍,希望能够给大家在实际运用中带来一定的帮助,负载均衡涉及的东西比较多,理论也不多,网上有很多书籍,今天我们就用创新互联在行业内累计的经验来做一个解答。
创新互联主营井研网站建设的网络公司,主营网站建设方案,成都app开发,井研h5微信平台小程序开发搭建,井研网站营销推广欢迎井研等地区企业咨询
实际生产环境中架构用到IIS+haproxy+keepalived+nginx,需要综合整理学习一下。
折腾半天haproxy,大面上配通,细节上还有很多需要整理。
环境:
前端:haproxy IP:192.168.71.128
后端WEB:
server01:apache 192.168.71.138(Linux)
http://192.168.71.138
server02:apache 192.168.71.135(windows)
http://192.168.71.135
试验目的:
前端haproxy为后端两台Web云服务器做负载均衡及灾备冗余。
2015-1-31
##############################################
1.vim /etc/rsyslog.conf
local2* /var/log/haproxy.log
2.vim /etc/sysconfig/rsyslog
SYSLOGD_OPTIONS="-c 2"
service rsyslog restart
3.vim /etc/haproxy/haproxy.conf
global
log 127.0.0.1 local2
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 40000
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
listen stats
mode http
bind *:1080
stats enable
stats hide-version
stats uri /haproxyadmin?stats
stats realm Haproxy\ Statistics
stats auth admin:admin
stats admin if TRUE
frontend web
bind *:8080
mode http
log global
option logasap
option dontlognull
capture request header Host len 20
capture request header Referer len 60
default_backend servers
backend servers
balance roundrobin
server websvr1 219.142.x.x:80 check maxconn 2000
server websvr2 219.142.x.x:80 check maxconn 2000
看了以上关于生产环境中架构用到IIS+haproxy+keepalived+nginx的综合介绍,如果大家还有什么地方需要了解的可以在创新互联行业资讯里查找自己感兴趣的或者找我们的专业技术工程师解答的,创新互联技术工程师在行业内拥有十几年的经验了。创新互联官网链接www.cdcxhl.com
分享题目:生产环境中架构用到IIS+haproxy+keepalived+nginx的综合介绍
本文网址:http://pwwzsj.com/article/isgpgj.html