• HaProxy配置


    安装

    http://www.cnblogs.com/wang1988ming/archive/2012/10/24/2737507.html

    配置

    global
            log 127.0.0.1   local0 info    #日志相关
            log 127.0.0.1   local1 notice
            maxconn 4096
            chroot /usr/local/haproxy
            uid root
            gid root
            daemon
            #debug
            #quiet
            pidfile /usr/local/haproxy/haproxy.pid
    
    defaults
            log     global
            mode    http
            #option httplog
            option  dontlognull
            retries 3
            option redispatch
            maxconn         2000
            contimeout      5000
            clitimeout      50000
            srvtimeout      50000
    
    listen  mysql
            bind 0.0.0.0:23306    #代理端口
            mode tcp              #模式 TCP
            option mysql-check user haproxy   #mysql健康检查  root为mysql登录用户名
            balance roundrobin            #调度算法
            server mysql1 192.168.18.1:3306 weight 1 check  inter 1s rise 2 fall 2 #健康检查加上check
            server mysql2 192.168.18.1:3307 weight 1 check  inter 1s rise 2 fall 2
    listen stats     #监控
               mode http
               bind 0.0.0.0:8888
               stats enable
               stats uri /dbs
               stats realm Global statistics
               stats auth admin:admin

    docker 参考:https://yq.aliyun.com/articles/664130

  • 相关阅读:
    P1312 [NOIP2011 提高组] Mayan 游戏
    Codeforces Round 736
    CF487E Tourists
    荏苒
    数论
    [NOI2009] 二叉查找树 题解
    元素
    线性基
    杂录
    SQL中关于Join、Inner Join、Left Join、Right Join、Full Join、On、 Where区别
  • 原文地址:https://www.cnblogs.com/newsea/p/5682287.html
Copyright © 2020-2023  润新知