安装

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

HaProxy配置的更多相关文章

  1. Python-day3作业-haproxy配置文件管理脚本

    #!/usr/bin/env python import os,sys,time,re,prettytable,json from collections import defaultdict,Ord ...

  2. Haproxy配置参数

    HAProxy配置中分成五部分内容,当然这些组件不是必选的,可以根据需要选择部分作为配置. ===================== global    参数是进程级的,通常和操作系统(OS)相关. ...

  3. openstack高可用haproxy配置

    #openstack高可用haproxy配置openstack pike 部署 目录汇总 http://www.cnblogs.com/elvi/p/7613861.html #openstack高可 ...

  4. haproxy配置基于ssl证书的https负载均衡

    本实验全部在haproxy1.5.19版本进行测试通过,经过测试1.7.X及haproxy1.3版本以下haproxy配置参数可能不适用,需要注意版本号. 一.业务要求现在根据业务的实际需要,有以下几 ...

  5. haproxy配置详解

    先看一个ha的配置文件: # # Global settings # global # to have these messages end up in /var/log/haproxy.log yo ...

  6. HAproxy 配置参数详解

    HAproxy 配置参数详解 /etc/haproxy/haproxy.cfg # 配置文件 ----------------------------------------------------- ...

  7. redis sentinel集群配置及haproxy配置

    ip分布情况: sentinel-1/redis 主 10.11.11.5 sentinel-2/redis 从 10.11.11.7 sentinel-3/redis 从 10.11.11.8 ha ...

  8. socat管理haproxy配置 ssh-keygen -N '' -t rsa -q -b 2048

    socat管理haproxy配置   haproxy是可以通过socat命令管理haproxy.cfg文件的:1.安装socat yum install socat -y 2.配置haproxy.cf ...

  9. 利用keepalived和haproxy配置mysql的高可用负载均衡

    实验系统:CentOS 6.6_x86_64(2.6.32-504.30.3.el6.x86_64) 实验前提:防火墙和selinux都关闭 实验说明:本实验共有4台主机,IP分配如拓扑 实验软件:k ...

随机推荐

  1. oracle表分区以及普表转分区表(转)

    概述 Oracle的表分区功能通过改善可管理性.性能和可用性,从而为各式应用程序带来了极大的好处.通常,分区可以使某些查询以及维护操作的性能大大提高.此外,分区还可以极大简化常见的管理任务,分区是构建 ...

  2. C#创建文件夹,往里追字符串。

    /// <summary>写文本日志</summary> /// <param name="StrMessage">日志消息</param ...

  3. Linux init

    -bash: netstat: command not found #pacman -S net-tools

  4. Beginning Scala study note(3) Object Orientation in Scala

    1. The three principles of OOP are encapsulation(封装性), inheritance(继承性) and polymorphism(多态性). examp ...

  5. mysql的查询、子查询及连接查询

    >>>>>>>>>> 一.mysql查询的五种子句         where(条件查询).having(筛选).group by(分组). ...

  6. Linux内核笔记——进程管理之执行体

    内核版本:linux-2.6.11 在Linux中,有多种执行体(指令流.执行单位),它们是CPU调度和分配资源的基本单位,它们是内核态可见的,即内核态下,每一种执行体都有对应的唯一数据结构task_ ...

  7. iOS 与 惯性滚动

    注:以下所有例子均 只 在 iOS 的微信中测试过,但对于饿了么APP的内置浏览器同样适用(两者使用相同内核) 引题 工作中常常有需要显示大量信息的情况,列表超出一屏就涉及到滚动的问题.例如 - va ...

  8. strong,weak, retain, assign的区别

    strong,weak, retain, assign的区别 strong与weak是由ARC新引入的对象变量属性 xcode 4.2(ios sdk4.3和以下版本)和之前的版本使用的是retain ...

  9. mysql中生产表格多列统计问题

    for Example: select date_format(date,'%Y-%m-%d') as day, count(case when xinghao='a' then 1 end) as  ...

  10. 彻底理解webservice SOAP WSDL

    WebServices简介 先给出一个概念 SOA ,即Service Oriented Architecture ,中文一般理解为面向服务的架构, 既然说是一种架构的话,所以一般认为 SOA 是包含 ...