Installing haproxy load balancing for http and https--转载
来源:互联网 发布:java多用户商城 编辑:程序博客网 时间:2024/04/29 08:09
This example will guide you through a simple IP based load balancing solution that handles ssl traffic.
The Configuration =
- Load Balancer: <192.168.0.2> // will be our haproxy server
- Web Server 1: <192.168.0.10> // web application server 1
- Web Server 2: <192.168.0.20> // web application server 2
- Admin Panel Port 8080: <192.168.0.2> // Statistics Panel on port 8080
Web Server 1
Load Balancer <
Web Server 2
Step 1: Get and Install haproxy
We’ll be using the 1.3.17 src files to install haproxy. You can get them from http://haproxy.1wt.eu/
- wget http://haproxy.1wt.eu/download/1.3/src/haproxy-1.3.17.tar.gz
- cd haproxy-1.3.17
- make TARGET=linux26
- cp /path/to/haproxy-1.3.17/examples/haproxy.init /etc/init.d/haproxy
- chmod +x /etc/init.d/haproxy
We’re going to add a haproxy user and run it in a chroot jail. Be sure to read up on other security measures for your server.
- useradd haproxy
- mkdir /var/chroot/haproxy
- chown haproxy:haproxy /var/chroot/haproxy
- chmod 700 /var/chroot/haproxy
This will be a simple load balancing. The HAProxy server will listen to 1 IP and distribute to 2 servers.
- global
- maxconn 10000 # Total Max Connections.
- log 127.0.0.1 local0
- log 127.0.0.1 local1 notice
- daemon
- nbproc 1 # Number of processes
- user haproxy
- group haproxy
- chroot /var/chroot/haproxy
- defaults
- log global
- option httplog
- mode tcp
- clitimeout 60000
- srvtimeout 30000
- contimeout 4000
- retries 3
- redispatch
- option httpclose
- listen load_balanced 192.168.0.2:80,192.168.0.2:443
- balance source
- option ssl-hello-chk
- option forwardfor
- server webserver1 192.168.0.10 weight 1 maxconn 5000 check
- server webserver2 192.168.0.20 weight 1 maxconn 5000 check
- listen admin_stats 192.168.0.2:8080
- mode http
- stats uri /my_stats
- stats realm Global\ statistics
- stats auth username:password
Step 4: Configuring logging
Edit /etc/sysconfig/syslog
- SYSLOGD_OPTIONS=”-m 0 -r”
0 0
- Installing haproxy load balancing for http and https--转载
- How to Configure Tomcat/JBoss and Apache HTTPD for Load Balancing and Failover
- Load Balancing Servers, Firewalls, and Caches
- RMI Load Balancing , Failover and High-Availability
- Failover and Load balancing in Oracle
- Load Balancing
- load balancing
- Load Balancing
- Load Balancing
- 实践NGINX Load Balancing – HTTP Load Balancer
- install mongrel for rails and apache http for load balance
- CakePHP --- Load Balancing and MySQL Master and Slaves
- haproxy 中的http请求和https请求
- Client Side Load Balancing for Web 2.0 Applications
- 通过url获取远程文件(for http and https)
- http and https
- HTTP and HTTPS
- Load Balancing Web Applications
- Keepalived配置与使用--转载
- redis学习资料
- linux下c的网络编程---转载
- Linux下C语言的调试--转
- haproxy配置文件详解--转
- Installing haproxy load balancing for http and https--转载
- HAProxy Installation and Configuration on CentOS 6.4 to Mitigate The Effects of Abusive Clients--转
- 软件级负载均衡器(LVS/HAProxy/Nginx)的特点简介和对比
- Install Tomcat 6 on CentOS or RHEL --转载
- haproxy 学习记录
- shell:syntax error:unexpected end of file/Starting proxy www-balancer: cannot bind socket--转载
- 信托2013:信托公司精心布局业务创新
- BEA-141150 - An error occurred while preparing application component uri of application application with HTTP response responseC
- eclipse 中文件引用报错不能编译,但引用文件确实存在