当前位置:网站首页>Haproxy high availability solution
Haproxy high availability solution
2022-07-04 13:46:00 【51CTO】
Add --line-numbers Options
Factors that measure load balancer performance
Session rate Conversation rate : Number of sessions per minute
Session concurrency Number of concurrent sessions : The longer the server takes to process the session , The more concurrent sessions ;
Date rate Data rate : With MB/s、Mbps To measure
HaProxy brief introduction
Official website : https://www.haproxy.org/
HAProxy Is a free load balancing software , Can run on most mainstream Linux On the operating system .
Suitable for heavy load Web Site , These sites usually need session persistence or seven layer proxy .
HAProxy Core functions
- Load balancing :L4 and L7 Two modes , Support RR/ static state RR/LC/IP Hash/URI Hash/URL_PARAM Hash/HTTP_HEADER Hash And so on
- health examination : Support TCP and HTTP Two modes of health examination
- Conversation retention : For application clusters without session sharing , It can be done by Insert Cookie/Rewrite Cookie/Prefix Cookie, And many of the above Hash Method to achieve session retention
- SSL:HAProxy Can be parsed HTTPS agreement , And can decrypt the request as HTTP Back to back end transmission
- HTTP Request rewriting and redirection
- Monitoring and statistics :HAProxy Provides the basis for Web The statistics page of , Show health status and traffic data . Based on this function , Users can develop monitoring programs to monitor HAProxy The state of
HAProxy Working mode
- http: The client request is deeply analyzed and then sent to the server ;
- tcp:4 Layer scheduling , Do not check the information on the seventh floor ;
- Health: Just a health check ( Not recommended );
HAProxy Advantages and disadvantages
advantage
- Support sessio、cookie function ;
- Can pass Url Take a health check ;
- efficiency 、 Load balancing speed is higher than Nginx And below LVS;
- HAProxy Support TCP, It can be done to MySQL Load balancing ;
- Rich scheduling algorithms ;
shortcoming
- Regular expressions are weaker than Nginx;
- Logs depend on Syslogd;
HAProxy install
1) install haproxy
CentOS The system can use yum Install directly
see HAProxy edition
2022 The latest version in is 2.6
2) Modify the configuration file
$
v
i
m
/
e
t
c
/
h
a
p
r
o
x
y
/
h
a
p
r
o
x
y
.
c
f
g
g
l
o
b
a
l
l
o
g
1
2
7
.
0
.
0
.
1
l
o
c
a
l
2
c
h
r
o
o
t
/
v
a
r
/
l
i
b
/
h
a
p
r
o
x
y
p
i
d
f
i
l
e
/
v
a
r
/
r
u
n
/
h
a
p
r
o
x
y
.
p
i
d
#
p
i
d
writing
Pieces of
m
a
x
c
o
n
n
4
0
0
0
#
most
Big
even
Pick up
Count
(
Silent
recognize
4
0
0
0
)
u
s
e
r
h
a
p
r
o
x
y
g
r
o
u
p
h
a
p
r
o
x
y
d
a
e
m
o
n
#
take
Into the
cheng
discharge
Enter into
d
e
a
m
o
n
model
type
shipment
That's ok
;
d
e
f
a
u
l
t
s
m
o
d
e
h
t
t
p
#
work
do
model
type
(
Silent
recognize
h
t
t
p
)
l
o
g
g
l
o
b
a
l
#
Mining
use
whole
game
set
The righteous
Of
Japan
Records
o
p
t
i
o
n
h
t
t
p
l
o
g
#
Japan
Records
class
other
(
h
t
t
p
Japan
Records
grid
type
)
o
p
t
i
o
n
d
o
n
t
l
o
g
n
u
l
l
#
No
remember
record
healthy
kang
check
check
Of
Japan
Records
Letter
Rest
o
p
t
i
o
n
h
t
t
p
-
s
e
r
v
e
r
-
c
l
o
s
e
o
p
t
i
o
n
f
o
r
w
a
r
d
f
o
r
e
x
c
e
p
t
1
2
7
.
0
.
0
.
0
/
8
o
p
t
i
o
n
r
e
d
i
s
p
a
t
c
h
#
S
e
r
v
e
r
i
d
clothing
service
device
hang
fall
after
strong
system
set
towards
To
Its
it
healthy
kang
Of
clothing
service
device
On
r
e
t
r
i
e
s
3
#
even
Pick up
loss
Defeat
To
3
Time
after
Just
ren
service
clothing
service
No
can
use
t
i
m
e
o
u
t
h
t
t
p
-
r
e
q
u
e
s
t
1
0
s
t
i
m
e
o
u
t
q
u
e
u
e
1
m
t
i
m
e
o
u
t
c
o
n
n
e
c
t
1
0
s
t
i
m
e
o
u
t
c
l
i
e
n
t
1
m
#
customer
Household
End
even
Pick up
super
when
f
r
o
n
t
e
n
d
m
a
i
n
*:
5
0
0
0
#
prison
listen
Of
End
mouth
d
e
f
a
u
l
t
_
b
a
c
k
e
n
d
a
p
p
#
take
please
seek
turn
Hair
To
name
by
“
a
p
p
”
Of
after
End
clothing
service
b
a
c
k
e
n
d
s
t
a
t
i
c
#
set
The righteous
after
End
clothing
service
b
a
l
a
n
c
e
r
o
u
n
d
r
o
b
i
n
s
e
r
v
e
r
s
t
a
t
i
c
1
2
7
.
0
.
0
.
1:
4
3
3
1
c
h
e
c
k
b
a
c
k
e
n
d
a
p
p
b
a
l
a
n
c
e
r
o
u
n
d
r
o
b
i
n
s
e
r
v
e
r
a
p
p
1
1
2
7
.
0
.
0
.
1:
5
0
0
1
c
h
e
c
k
l
i
s
t
e
n
s
t
a
t
u
s
b
i
n
d
*:
1
0
2
5
0
#
set
The righteous
prison
control
page
Noodles
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
- 20.
- 21.
- 22.
- 23.
- 24.
- 25.
- 26.
- 27.
- 28.
- 29.
- 30.
- 31.
- 32.
- 33.
- 34.
- 35.
{ The configuration file consists of }
global: Global configuration block , Configuration parameters take effect globally ;
default: Set the default parameters for other parts that follow , The default parameters can be reset by subsequent parts ( That is, the subsequent configuration shall prevail );
frontend: Define front-end Services ;
backend: Define back end services
3) Service start stop
$
s
y
s
t
e
m
c
t
l
e
n
a
b
l
e
-
-
n
o
w
h
a
p
r
o
x
y
.
s
e
r
v
i
c
e
#
Qi
dynamic
h
a
p
r
o
x
y
and
set up
Set up
by
open
machine
since
Qi
$
s
y
s
t
e
m
c
t
l
s
t
a
t
u
s
h
a
p
r
o
x
y
.
s
e
r
v
i
c
e
#
check
see
clothing
service
shape
state
$
s
y
s
t
e
m
c
t
l
s
t
o
p
h
a
p
r
o
x
y
.
s
e
r
v
i
c
e
#
stop
stop
h
a
p
r
o
x
y
.
s
e
r
v
i
c
e
- 1.
- 2.
- 3.
monitor HAProxy state
see HAProxy Service port , Then through the host IP: The port is accessed in the browser HAProxy Monitoring page of .
$ ss -ntulp | grep haproxy


remarks
- Queue Information about queue data ( The current number of queues , Maximum , Queue limit number );
- Session rate Session rate per second ( Current value , Maximum , Limited quantity );
- Sessions There will always be a lot of talk ( Current value , Maximum , Total amount ,Lbtot: total number of times a server was selected Total time taken to select a server );
- Bytes( Inbound 、 Outbound flow );
- Denied( Refuse request 、 Reject response );
- Errors( Wrong request 、 Wrong connection 、 Wrong response );
- Warnings( Try warning again retry、 Reconnect the redispatches);
- Server( state 、 The last time to check ( How long ago was the last inspection performed )、 The weight 、 Number of backup servers 、down Number of servers 、down Machine time ).
边栏推荐
- When MDK uses precompiler in header file, ifdef is invalid
- Comparative study of the gods in the twilight Era
- 请问大佬们有遇到这个情况吗,cdc 1.4 连接MySQL 5.7 无法使用 timestamp
- Comprehensive evaluation of modular note taking software: craft, notation, flowus
- C语言程序设计
- Golang sets the small details of goproxy proxy proxy, which is applicable to go module download timeout and Alibaba cloud image go module download timeout
- Zhongang Mining: in order to ensure sufficient supply of fluorite, it is imperative to open source and save flow
- Alibaba cloud award winning experience: build a highly available system with polardb-x
- Alibaba cloud award winning experience: build a highly available system with polardb-x
- JVM series - stack and heap, method area day1-2
猜你喜欢

嵌入式编程中五个必探的“潜在错误”

Samsung's mass production of 3nm products has attracted the attention of Taiwan media: whether it can improve the input-output rate in the short term is the key to compete with TSMC

SQL statement syntax error in test SQL statement deletion in eclipse linked database

2022年中国移动阅读市场年度综合分析
高效!用虚拟用户搭建FTP工作环境

7 月数据库排行榜:MongoDB 和 Oracle 分数下降最多

HAProxy高可用解决方案

Practice: fabric user certificate revocation operation process

光环效应——谁说头上有光的就算英雄
![[AI system frontier dynamics, issue 40] Hinton: my deep learning career and research mind method; Google refutes rumors and gives up tensorflow; The apotheosis framework is officially open source](/img/2c/b1d6277c1b23a6a77f90d5b2874759.png)
[AI system frontier dynamics, issue 40] Hinton: my deep learning career and research mind method; Google refutes rumors and gives up tensorflow; The apotheosis framework is officially open source
随机推荐
CTF competition problem solution STM32 reverse introduction
C basic supplement
Commvault 和 Oracle 合作,在 Oracle 云上提供 Metallic数据管理即服务
Use fail2ban to prevent password attempts
Agile development / agile testing experience
Personalized online cloud database hybrid optimization system | SIGMOD 2022 selected papers interpretation
Oracle 被 Ventana Research 评为数字创新奖总冠军
模块化笔记软件综合评测:Craft、Notion、FlowUs
AI 绘画极简教程
基于链表管理的单片机轮询程序框架
In 2022, it will be es2022 soon. Do you only know the new features of ES6?
After the game starts, you will be prompted to install HMS core. Click Cancel, and you will not be prompted to install HMS core again (initialization failure returns 907135003)
Golang sets the small details of goproxy proxy proxy, which is applicable to go module download timeout and Alibaba cloud image go module download timeout
CommVault cooperates with Oracle to provide metallic data management as a service on Oracle cloud
DGraph: 大规模动态图数据集
JVM series - stack and heap, method area day1-2
【云原生 | Kubernetes篇】深入了解Ingress(十二)
诸神黄昏时代的对比学习
Dgraph: large scale dynamic graph dataset
Backgroundworker usage example