码迷,mamicode.com
首页 > 其他好文 > 详细

Haproxy配置文件(haproxy.cfg)

时间:2018-02-28 14:42:13      阅读:325      评论:0      收藏:0      [点我收藏+]

标签:客户端   out   cal   eve   oba   dmi   tcp   --   健康   

#---------------------------------------------------------------------

# 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

log 127.0.0.1 local0 info

log 127.0.0.1 local1 notice

chroot /var/lib/haproxy

stats socket /run/haproxy/admin.sock mode 660 level admin

user haproxy

group haproxy

maxconn 65535

tune.maxaccept 65535

tune.ssl.default-dh-param 2048

daemon

defaults

option dontlognull #不记录监控检查日志信息

retries 3 #三次失败认为服务器不可用,也可通过后边设置

log global

option redispatch #当serverId对应的服务器挂掉后,强制定向到其他健康的服务器,以后将不支持

maxconn 65535 #默认最大的链接数

timeout client 50s #客户端超时

timeout server 50s #服务器超时

timeout connect 5s #连接超时

#Create mysql_proxy 迁移1组

listen mysql1

bind 0.0.0.0:33061

mode tcp

balance roundrobin

server mysql1 10.19.159.86:3306

listen mysql2

bind 0.0.0.0:33062

mode tcp

balance roundrobin

server mysql2 10.19.84.98:3306

listen mysql3

bind 0.0.0.0:33063

mode tcp

balance roundrobin

server mysql3 10.19.176.184:3306

listen mysql4

bind 0.0.0.0:33064

mode tcp

balance roundrobin

server mysql4 10.19.83.32:3306

listen mysql5

bind 0.0.0.0:33065

mode tcp

balance roundrobin

server mysql5 10.19.43.79:3306

listen mysql6

bind 0.0.0.0:33066

mode tcp

balance roundrobin

server mysql6 10.6.11.135:3306

listen mysql7

bind 0.0.0.0:33067

mode tcp

balance roundrobin

server mysql7 10.19.6.12:3306

listen mysql8

bind 0.0.0.0:33068

mode tcp

balance roundrobin

server mysql8 10.19.126.225:3306

listen mysql9

bind 0.0.0.0:33069

mode tcp

balance roundrobin

server mysql9 10.19.139.84:3306

listen mysql10

bind 0.0.0.0:3310

mode tcp

balance roundrobin

server mysql10 10.19.115.92:3306

listen mysql11

bind 0.0.0.0:3320

mode tcp

balance roundrobin

server mysql11 10.19.47.142:3306

listen mysql12

bind 0.0.0.0:3330

mode tcp

balance roundrobin

server mysql12 106.2.11.252:3306

listen mysql13

bind 0.0.0.0:3331

mode tcp

balance roundrobin

server mysql13 106.2.12.28:3306

listen mysql14

bind 0.0.0.0:3332

mode tcp

balance roundrobin

server mysql14 106.2.12.6:3306

listen mysql15

bind 0.0.0.0:3333

mode tcp

balance roundrobin

server mysql15 106.2.12.41:3306

listen mysql16

bind 0.0.0.0:3334

mode tcp

balance roundrobin

server mysql16 106.2.12.42:3306

 

Haproxy配置文件(haproxy.cfg)

标签:客户端   out   cal   eve   oba   dmi   tcp   --   健康   

原文地址:https://www.cnblogs.com/bazingafraser/p/8483424.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!