haproxy笔记之六:负载均衡MySQL服务的配置示例
2024-10-08 20:08:32
#---------------------------------------------------------------------
# Global settings
#---------------------------------------------------------------------
global
# to have these messages end up in /var/log/haproxy.log you will
# need to:
#
# ) configure syslog to accept network log events. This is done
# by adding the '-r' option to the SYSLOGD_OPTIONS in
# /etc/sysconfig/syslog
#
# ) 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
user haproxy
group haproxy
daemon defaults
mode tcp
log global
option httplog
option dontlognull
retries
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 listen stats
mode http
bind 0.0.0.0:
stats enable
stats hide-version
stats uri /haproxyadmin?stats
stats realm Haproxy\ Statistics
stats auth admin:admin
stats admin if TRUE frontend mysql
bind *:
mode tcp
log global
default_backend mysqlservers backend mysqlservers
balance leastconn
server dbsrv1 192.168.10.11: check port intval rise fall maxconn
server dbsrv2 192.168.10.12: check port intval rise fall maxconn
最新文章
- Android笔记:动画
- VS2012 集成 IL DASM IL微软中间语言查看器
- monkeyrunner之电脑安装驱动(五)
- android 断点下载---XUtils
- Solr部署到Tomcat
- 框架SpringMVC笔记系列 二 传值
- ArcGIS Server 创建站点失败
- mvc:resources
- 2. 星际争霸之php面向对象(二)
- HttpWebRequest与HttpWebResponse使用例子(转)
- ArcObjects SDK(AE)10.1在vs2012安装的方法
- dll的加载方式主要分为两大类,显式和隐式链接
- 层次查询start with ... connect by
- SecureCRT辅助解决方案
- CDONTS组件
- AspNet Core 初步认识
- Oracle-11:联合查询
- idea构建maven多项目web架构
- CUDA compiler driver nvcc 散点 part 2
- SWPU-ACM集训队周赛之组队赛(3-11) C题题解