1. Install Haproxy 
    CentOS/RHEL 5 , 32 bit:
    # rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm 
    CentOS/RHEL 5 , 64 bit:
    # rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm 
    CentOS/RHEL 6 , 32 bit:
    # rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm 
    CentOS/RHEL 6 , 64 bit:
    # rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
    yum -y install haproxy
  2. Configure Haproxy
    vi /etc/haproxy/haproxy.cfg
    global
    log 127.0.0.1 local0
    log 127.0.0.1 local1 debug
    maxconn # Total Max Connections.
    daemon
    nbproc # Number of processing cores.
    defaults
    log global
    mode http
    option httplog
    option dontlognull
    retries
    option redispatch
    maxconn
    timeout server
    timeout connect
    timeout client
    timeout queue 1000s # [HTTP Site Configuration]
    listen http_web 10.10.0.112:
    mode http
    balance roundrobin # Load Balancing algorithm
    option httpchk
    option forwardfor
    server server1 23.253.48.253: weight maxconn check
    server server2 208.43.40.162: weight maxconn check # [Change HAProxy Stats URL]
    listen stats 10.10.0.112:
    mode http
    log global
    balance roundrobin maxconn timeout server
    timeout connect
    timeout client
    timeout queue 1000s stats enable
    stats hide-version
    stats refresh 30s
    stats show-node
    stats realm Haproxy\ Statistics
    stats auth admin:password
    stats uri /ha-stats

    haproxy Code

    开启防火墙 1936 端口

  3. 重启相关服务
    service iptables restart 
    service haproxy restart
    chkconfig haproxy on
  4. 后台查看网站:
    http://10.10.0.112:1936/ha-stats  or  http://10.10.0.112:1936/stats
  5. 参考链接:
    http://tecadmin.net/install-and-configure-haproxy-on-centos/

How to intall and configure Haproxy on Centos的更多相关文章

  1. Configure Ocserv on CentOS 6

    Configure Ocserv on CentOS 6 Table of Contents 1. Install ocserv 2. Configure ocserv 3. How to host ...

  2. [scrapy-redis] install and configure scrapy-redis on CentOS 7 (1)

    0. 安装依赖 yum install -y zlib zlib-devel openssl openssl-devel bzip2 bzip2-devel sqlite-devel gcc wget ...

  3. haproxy 在centos上cannot bind 端口的问题

    setsebool -P haproxy_connect_any=1 要不把selinux干掉也行

  4. IP Failover Setup using Keepalived on CentOS/Redhat 6

    source url:http://tecadmin.net/ip-failover-setup-using-keepalived-on-centos-redhat-6/ Keepalived is ...

  5. Centos7 编译安装 Nginx PHP Mariadb Memcached 扩展 ZendOpcache扩展 (实测 笔记 Centos 7.3 + Mariadb 10.1.20 + Nginx 1.10.2 + PHP 7.1.0 + Laravel 5.3 )

    环境: 系统硬件:vmware vsphere (CPU:2*4核,内存2G,双网卡) 系统版本:CentOS-7-x86_64-Minimal-1611.iso 安装步骤: 1.准备 1.0 查看硬 ...

  6. Cenos7 编译安装 Mariadb Nginx PHP Memcache ZendOpcache (实测 笔记 Centos 7.0 + Mariadb 10.0.15 + Nginx 1.6.2 + PHP 5.5.19)

    环境: 系统硬件:vmware vsphere (CPU:2*4核,内存2G,双网卡) 系统版本:CentOS-7.0-1406-x86_64-DVD.iso 安装步骤: 1.准备 1.1 显示系统版 ...

  7. Configuring Network in CentOS 6.3 Virtual Box + Screenshots

    Configuring Network in CentOS 6.3 Virtual Box + Screenshots Posted: May 23, 2013 in Uncategorized Ta ...

  8. 编译安装LNMP Centos 6.5 x64 + Nginx1.6.0 + PHP5.5.13 + Mysql5.6.19

    (来自:http://www.cnblogs.com/vicowong/archive/2011/12/01/2116212.html) 环境: 系统硬件:vmware vsphere (CPU:2* ...

  9. Centos7 编译安装 Nginx PHP Mariadb Memcache扩展 ZendOpcache扩展 (实测 笔记 Centos 7.0 + Mariadb 10.1.9 + Nginx 1.9.9 + PHP 5.5.30)

    环境: 系统硬件:vmware vsphere (CPU:2*4核,内存2G,双网卡) 系统版本:CentOS-7-x86_64-Minimal-1503-01.iso 安装步骤: 1.准备 1.1 ...

随机推荐

  1. iOS- 利用AFNetworking(AFN) - 实现文件断点下载

    https://www.cnblogs.com/qingche/p/3500746.html 1. 定义一个全局的AFHttpClient:包含有 1> baseURL 2> 请求 3&g ...

  2. Elasticsearch IK+pinyin

    如何在Elasticsearch中安装中文分词器(IK+pinyin)   如果直接使用Elasticsearch的朋友在处理中文内容的搜索时,肯定会遇到很尴尬的问题——中文词语被分成了一个一个的汉字 ...

  3. PAT L3-020 至多删三个字符

    https://pintia.cn/problem-sets/994805046380707840/problems/994805046946938880 给定一个全部由小写英文字母组成的字符串,允许 ...

  4. [转帖]Windows 操作系统有哪些原生的工具和软件不被人了解却很有用?

    Windows 操作系统有哪些原生的工具和软件不被人了解却很有用? 蛋蛋 司马米青E1E1九木 https://www.zhihu.com/question/25343481/answer/30798 ...

  5. 关于windows注册表

    Windows 注册表 应该是一个 数据库.里面包含操作系统以及在其上的软件配置信息和旗下的硬件配置信息,有点就是整体和全面,控制面包和gpedit.msc 组策略应该是抽象过后的注册表配置信息, W ...

  6. Oracle列转行函数LISTAGG()

    --Oracle列转行函数LISTAGG() with tb_temp as( select 'China' 国家,'Wuhan' 城市 from dual union all select 'Chi ...

  7. php 生成订单号201807205598981

    php版 /** * 生成唯一订单号 */ public function build_order_no() { $no = date('Ymd').substr(implode(NULL, arra ...

  8. python之tips(三)--为什么Python有相同的不可变对象id不同?

    参考 : https://www.jianshu.com/p/0f6f0db0ce8f

  9. Golang的md5 hash计算

    Golang计算md5值的方法都是接收byte型slice([]byte).而且使用习惯上也觉得略奇怪. 看了好几个例子才看懂. 感觉Golang标准库在设计这些模块的时候,都会考虑使用带New关键字 ...

  10. css的类选择器

    css的类选择形式 .类名{} 通配类选择器:*.类名{} 某种元素的类选择器:元素名.类名{} 多类选择器:<p class="css1  css2"></p& ...