Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Server \ HAProxy Windows version of the compiler and its application in the CORS     - Using PPA to install the lightweight theme software HotShots 2.1.0 under Ubuntu (Linux)

- Python regular expressions: how to use regular expressions (Programming)

- Taught you how to build your own VPS server (Server)

- Java regular expressions examples (Programming)

- PL / SQL how to make the program every few seconds to insert a data (Database)

- Windows 7 hard disk to install Ubuntu 14.10 (Linux)

- Node.JS different ways to install under Ubuntu 15.04 (Linux)

- Linux Telnet access Windows 7 configuration procedure (Linux)

- VMware virtual machine to install CentOS 6.2 (Linux)

- How to compile and install wxWidgets in Ubuntu / Debian / Linux Mint (Linux)

- Use smartmontools view the health status of hard disk (Linux)

- Use apt-p2p up a local Debian package cache (Server)

- Linux basic articles of the boot process (Linux)

- How to add two-factor authentication for Linux systems SSH (Linux)

- Forgot Linux root password (Linux)

- How to protect your eyes automatically adjust the screen brightness on Linux (Linux)

- How to install Ubuntu strategy game Wesnoth 1.12.0 (Linux)

- Use in Linux ipmitool tool (Linux)

- Three methods easy data encryption on Linux (Linux)

- WebLogic administrator account and reset the password (Database)

 
         
  HAProxy Windows version of the compiler and its application in the CORS
     
  Add Date : 2018-11-21      
         
         
         
 

I. HAProxy Introduction

HAProxy provide high availability, load balancing, and proxy TCP and HTTP-based applications, it is free, fast and reliable a solution. HAProxy especially for those who load oversized web sites that usually they need to maintain or seven treatment sessions. HAProxy run on current hardware, can support thousands of concurrent connections. And its mode of operation so that it can easily be integrated into your current security architecture, while protecting your web server is not exposed to the network.

HAProxy implements an event-driven, single process model that supports a very large number of concurrent connections. Multi-process or multi-threaded model memory-bound, system scheduler limits and restrictions everywhere in the lock, rarely able to handle thousands of concurrent connections. Event-driven model because there are better resources and time management client (User-Space) to achieve all of these tasks, there is no such problem. The drawbacks of this model is that in the multi-core system, these programs are usually poor scalability. That is why they must be optimized so that each CPU time slice (Cycle) to do more work. The following figure shows the HAProxy load balancing application model:

 

 

II. FEASIBILITY

For many advantages HAProxy will apply CORS (Continuous Operating GPS integrated system) can effectively improve the operation and maintenance of existing maximum load capacity, reduce the waste of hardware resources, and ensure system availability and stability . Specifically, set forth in the following aspects:

1. TCP-based proxy server acts as a proxy in the reference station data stream distribution process function;

2. TCP proxy user access and data delivery processes for load balancing based on the role of balancer;

For the number of users, high concurrency of CORS, the use of external service request HAProxy corresponding port to the control center of the internal network of a plurality of identical function application (such as IGate / TNC, etc.) of port services, can HAProxy a variety of ways (IP, cookie, session) to keep tcp link affinity to ensure the correctness of data interaction. Numerous load-balancing algorithms, internal shared service program overall service pressure, when a program down off, HAProxy can automatically distribute relevant tcp links to other service programs. HAProxy achieve eight kinds of load balancing algorithms:

roundrobin, it represents a simple poll static-rr, expressed according to the weight, may empower
according to server performance leastconn, it represents the minimum connection, first processing source, the request indicates the source IP uri, according to the requested URI represents url_param, expressed according to URl request parameter 'balance url_param' requires an URL parameter name hdr (name), it represents the HTTP request header lock every HTTP request rdp-cookie (name), according to data showing cookie (name) to lock and hash every TCP request

3. Based on tcp proxy to achieve internal network firewall NAT function.

 

three .HAProxy installation and configuration

text prepared HAProxy latest stable version of the download address: http: //haproxy.1wt.eu/download/1.4/src/haproxy-1.4.25.tar.gz.

1.Linux under HAProxy installation

tar zcvf   haproxy-1.4.25.tar.gz   cd   haproxy-1.4.25 make TARGET = linux28 PREFIX = / usr / local / haprpxy make install PREFIX = / usr / local / haproxy cd / usr / local / haproxy vim haproxy.cfg   edit the configuration file, a unified set forth the relevant configuration details later / Usr / local / haproxy / sbin / haproxy -f /usr/local/haproxy/haproxy.cfg    just use the configuration file to start HAProxy

2. Windows under HAProxy compile and install

Download the cygwin installation tool when preparing their articles 64 download address: https: //cygwin.com/setup-x86_64.exe. Run the program, the program screenshot below: Install gcc, state Keep the machine is installed, check the box, if not installed Bin column Installation make tools. Download HAProxy Source Package copied to: C: cygwin64 home, and unzip to the directory, Use Cywin64 Terminal command-line tool to enter HAProxy catalog: make   TARGET = cygwin make install so haproxy.exe it translated well, and will haproxy.exe cygwin1.dll copy it for use. Consistent with the operating mode under Linux environment.

3.HAProxy configuration file parsing

######## default configuration ############
defaults mode http # default mode
mode {tcp | http | health}, tcp is four layers, http is a layer 7, health will only return OK
retries 2 # connection fails twice that it is the server is unavailable, you can also set back
option redispatch # when serverId corresponding server hang, forcing directed to other healthy servers
option abortonclose # when high server load time, automatic off the end of the current relatively long queue processing link
maxconn 4096 # the default maximum number of connections
timeout connect 5000ms # connection timeout
timeout client 30000ms # client timeout
timeout server 30000ms # server timeout
#timeout check 2000 # = heartbeat timeout
log 127.0.0.1 local0 err # [err warning info debug]


######## ######## statistics configuration page
listen admin_stats
bind 0.0.0.0:1080 # listening port
mode http #http seven-layer model
option httplog # using http log format
#log 127.0.0.1 local0 err
maxconn 10
stats refresh 30s # statistics page automatically refresh time
stats uri / stats # statistics page url
stats realm XingCloud prompt text on the statistics page password box Haproxy #
stats auth admin: admin # statistics page the user name and password setting
on stats hide-version # Hide statistics page HAProxy version information


##### ### test1 configuration #################
listen test1
bind 0.0.0.0:90
mode tcp
#maxconn 4086
#log 127.0.0.1 local0 debug
server s1 10.18.138.201:80
server s2 10.18.102.190:80
server s3 10.18.102.189:80
server s4 10.18.102.188:80
server s5 10.18.102.187:80
######## frontend configuration ##############


######## test2 configuration #################
listen test2
bind 0.0.0.0:91
mode tcp
#maxconn 4086
#log 127.0.0.1 local0 debug
server s1 10.18.138.130:80 weight 1
server s2 10.18.138.201:8080 weight 6
######## frontend configuration ##############

4. Examples of test

To test the effect of running we use the simplest configuration to make a simple tcp proxy:

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


######## default configuration ############
defaults
mode http # default mode mode {tcp | http | health}, tcp is four layers, http is a layer 7, health will only return OK
retries 2 # connection failure is considered to be twice server is unavailable, you can also set the
option redispatch # when serverId corresponding server hangs behind the rear by forcibly directed to other healthy servers
option abortonclose # when high server load time, automatically ends out the current queue processing relatively long link
maxconn 4096 # the default maximum number of connections
timeout connect 5000ms # connection timeout
timeout client 30000ms # client timeout
timeout server 30000ms # server timeout
#timeout check 2000 # = heartbeat timeout
log 127.0.0.1 local0 err # [err warning info debug]


######## statistics page layout ########
listen admin_stats
bind 0.0.0.0:1080 # listening port
mode http #http seven-layer model using the
option httplog # http log format
#log 127.0.0.1 local0 err
maxconn 10
stats refresh 30s # statistics page automatically refresh time
stats uri / stats # statistics page url
stats realm XingCloud prompt on the statistics page Haproxy # password text box
stats auth admin: admin # statistics page the user name and password setting
on stats hide-version # Hide statistics page HAProxy version information


######## test1 configuration #################
listen test1
bind 0.0.0.0:81
mode tcp
#maxconn 4086
#log 127.0.0.1 local0 debug
server s1 192.168.1.200:8000

server s1 192.168.1.201:8001

server s1 192.168.1.202:8002
######## frontend configuration ##############


######## test2 configuration #################
listen test2
bind 0.0. 0.0: 91
mode tcp
#maxconn 4086
#log 127.0.0.1 local0 debug
server s1 192.168.1.100:9000

server s1 192.168.1.101:9001

server s1 192.168.1.102:9002
######## frontend configuration ##############

     
         
         
         
  More:      
 
- Linux Change ssh port and disable remote root login at (Linux)
- Linux text processing tool of sed (Linux)
- Profile Linux users login shell and login to read (Linux)
- Kubernetes resolve application deployment model (Server)
- expdp / impdp use version parameter data migration across versions (Database)
- Android project and coding specifications (Programming)
- Windows 7 hard disk to install Ubuntu 15.04 (Linux)
- Ubuntu PPA install SMPlayer 14.9 (Linux)
- PPA on Ubuntu Linux installation Plank 0.8.0 (Linux)
- Install multiple Linux distributions and Fedora 21 first experience on the same hard disk (Linux)
- Android timer use (Programming)
- UNIX how to restrict users by IP Telnet (Linux)
- To convert into a binary search tree sorted doubly linked list (Programming)
- Java source implementation of the observer pattern instance (Programming)
- PHP interview questions of design patterns (Programming)
- SecureCRT use the configuration detailed tutorial (Linux)
- 4 lvcreate example commonly used commands (Linux)
- Slow update statement Performance Analysis (Database)
- Shell Script: Bulk add users, and set the random character password (Programming)
- CentOS 6.4 OpenNebula installation (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.