wendu 发表于 2018-10-5 12:46:12

Mysql Cluster通过HAProxy实现负载均衡

global  
      daemon
  
      nbproc 1
  
      pidfile /var/run/haproxy.pid
  

  
defaults
  
      mode tcp          #默认的模式mode { tcp|http|health },tcp是4层,http是7层,health只会返回OK
  
      retries 3          #两次连接失败就认为是服务器不可用,也可以通过后面设置
  
      option redispatch      #当serverId对应的服务器挂掉后,强制定向到其他健康的服务器
  
      option abortonclose   #当服务器负载很高的时候,自动结束掉当前队列处理比较久的链接
  
      maxconn 4096      #默认的最大连接数
  
      timeout connect 5000ms   #连接超时
  
      timeout client 30000ms   #客户端超时
  
      timeout server 30000ms   #服务器超时
  
      timeout check 2000   #=心跳检测超时
  
      log global
  
listen mysql_cluster
  
    bind 10.10.91.71:3306
  
    mode tcp
  
    maxconn 4086
  
    server node2 10.10.91.72:3306
  
    server node3 10.10.91.75:3306


页: [1]
查看完整版本: Mysql Cluster通过HAProxy实现负载均衡