Nginx/HAProxy/keepalived 方案
来源:互联网 发布:js创建button不可点击 编辑:程序博客网 时间:2024/05/17 03:31
方案拓扑图
1。
mater 192.168.2.2
backup 192.168.2.3
virtual ip 10.0.0.10
HAProxy 在mater,backup上配置相同
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
#--------------------------------------------------------------------- # Global settings #--------------------------------------------------------------------- global log 127.0.0.1 local2 chroot /var/lib/haproxy pidfile /var/run/haproxy.pid maxconn 4000 user haproxy group haproxy daemon #--------------------------------------------------------------------- # common defaults that all the 'listen' and 'backend' sections will # use if not designated in their block #--------------------------------------------------------------------- defaults mode http log global option dontlognull option httpclose option httplog option forwardfor option redispatch timeout connect 10000 # default 10 second time out if a backend is not found timeout client 300000 timeout server 300000 maxconn 60000 retries 3 stats enable stats refresh 30s stats realm www.iiwoo.com stats uri /st #haproxy 监控页面的访问地址 stats auth admin:admin #查看监控页,输入的用户名和密码 ##开始 frontend web1 bind 0.0.0.0:80 default_backend app1 backend app1 balance roundrobin option httpchk GET /robots.txt option forwardfor cookie app1 insert nocache server w_1_4 192.168.2.21:80 weight 1 maxconn 5000 cookie w_1_4 check server w_1_5 192.168.2.22:80 weight 1 maxconn 5000 cookie w_1_5 check ##结束
2。
keepalived 的配置
mater
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
global_defs { notification_email { xx@qq.com } notification_email_from root@abc.com smtp_server ngts6009.krypt.com smtp_connect_timeout 30 router_id LVS_DEVEL } vrrp_instance VI_1 { state MASTER interface eth1 virtual_router_id 77 priority 100 advert_int 1 authentication { auth_type PASS auth_pass qiwenadmin } virtual_ipaddress { 192.168.1.9 } } virtual_server 192.168.1.9 80 { delay_loop 6 # 每隔 6 秒查询 realserver 状态 lb_algo rr lb_kind NAT nat_mask 255.255.255.0 persistence_timeout 50 # 同一IP 的连接50秒内被分配到同一台realserver protocol TCP # 用TCP监测realserver的状态 real_server 192.168.1.3 80 { weight 3 # 权重 TCP_CHECK { connect_timeout 10 # 10秒无响应超时 nb_get_retry 3 delay_before_retry 3 connect_port 80 } } real_server 192.168.1.4 80 { weight 3 TCP_CHECK { connect_timeout 3 delay_before_retry 3 connect_port 80 } } }
backup
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
global_defs { notification_email { 34214399@qq.com } notification_email_from root@ngts6009.krypt.com smtp_server ngts6009.krypt.com smtp_connect_timeout 30 router_id LVS_DEVEL } vrrp_instance VI_1 { state BACKUP interface eth0 virtual_router_id 77 priority 99 advert_int 1 authentication { auth_type PASS auth_pass qiwenadmin } virtual_ipaddress { 192.168.1.9 } } virtual_server 192.168.1.9 80 { delay_loop 6 # 每隔 6 秒查询 realserver 状态 lb_algo rr lb_kind NAT nat_mask 255.255.255.0 persistence_timeout 50 # 同一IP 的连接50秒内被分配到同一台realserver protocol TCP # 用TCP监测realserver的状态 real_server 192.168.1.3 80 { weight 3 # 权重 TCP_CHECK { connect_timeout 10 # 10秒无响应超时 nb_get_retry 3 delay_before_retry 3 connect_port 80 } } real_server 192.168.1.4 80 { weight 3 TCP_CHECK { connect_timeout 3 delay_before_retry 3 connect_port 80 } } }
- Nginx/HAProxy/keepalived 方案
- nginx+keepalived 高可用方案
- nginx+keepalived 高可用方案
- haproxy+keepalived
- HAProxy+Keepalived
- haproxy+keepalived
- HAproxy+keepalived
- haproxy+keepalived
- haproxy+keepalived
- Redis的冗余方案(keepalived, HAProxy, Redis Sentinel)
- 如何快速构建高可用集群(Keepalived+Haproxy+Nginx)
- lvs(+keepalived)、haproxy(+heartbeat)、nginx 负载均衡的比较分析
- keepalived+haproxy实现nginx与mysql负载均衡
- lvs(+keepalived)、haproxy(+heartbeat)、nginx 负载均衡的比较分析
- lvs(+keepalived)、haproxy(+heartbeat)、nginx 负载均衡的比较分析
- Saltstack自动部署Haproxy+keepalived+nginx+memcache+php(fastcgi)
- keepalived + nginx 实现高可用集群方案
- 基于keepalived的nginx高可用方案
- Qt 文件操作
- Centos Linux 下基于bind的智能DNS搭建
- BLOCK代码块
- jms重要概念笔记
- ddd
- Nginx/HAProxy/keepalived 方案
- How to Add Line Number into Oracle Form
- gzip, StringIO的压缩和解压
- ORACLE 自学随笔
- MYSQL数据库常用基本优化方式
- django启动错误
- 数据结构(七) --- 栈
- Android 中自定义控件和属性(attr.xml,declare-styleable,TypedArray)的方法和使用
- vim 使用技巧