haprox配置MySQL主从互备_haproxy笔记之六:负载均衡MySQL服务的配置示例

---------------------------------------------------------------------global

# to have these messages end upin /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

#

log127.0.0.1local2chroot /var/lib/haproxy

pidfile/var/run/haproxy.pid

maxconn4000user haproxy

group haproxy

daemon

defaults

mode tcp

log global

option httplog

option dontlognull

retries3timeout http-request 10s

timeout queue 1m

timeout connect 10s

timeout client 1m

timeout server 1m

timeout http-keep-alive 10s

timeout check 10s

maxconn600listen stats

mode http

bind0.0.0.0:1080stats enable

stats hide-version

stats uri/haproxyadmin?stats

stats realm Haproxy\ Statistics

stats auth admin:admin

stats adminifTRUE

frontend mysql

bind*:3306mode tcp

log global

default_backend mysqlservers

backend mysqlservers

balance leastconn

server dbsrv1192.168.10.11:3306 check port 3306 intval 2 rise 1 fall 2 maxconn 300server dbsrv2192.168.10.12:3306 check port 3306 intval 2 rise 1 fall 2 maxconn 300

haproxy笔记之六:负载均衡MySQL服务的配置示例

标签:queue   mysq   user   0.11   option   stc   ons   request   this

本条技术文章来源于互联网,如果无意侵犯您的权益请点击此处反馈版权投诉

本文系统来源:http://www.cnblogs.com/djoker/p/6396728.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值