当前位置:网站首页>[cluster] haproxy load balancing
[cluster] haproxy load balancing
2022-06-11 07:34:00 【Sprite, don't be angry】
List of articles
Preface
The content of this blog is only to record the thoughts of bloggers , For reference only , Everything is subject to the results of their own practice .
One 、haproxy Load balancing
1.0 Architecture Overview
| effect | IP Address | Installation services |
|---|---|---|
| Main load balancer | 192.168.13.10 | haproxy-1.5.19 |
| Node server 1 | 192.168.13.20 | httpd |
| Node server 2 | 192.168.13.30 | httpd |
| Log collector | 192.168.13.40 | ipvsadm/keepalived |
1.1 Load balancing scheduler
systemctl stop firewalld
setenforce 0
yum install -y pcre-devel bzip2-devel gcc gcc-c++ make
Upload compressed package
tar zxvf haproxy-1.5.19.tar.gz
cd haproxy-1.5.19/
make TARGET=linux2628 ARCH=x86_64
make install
mkdir /etc/haproxy
cp examples/haproxy.cfg /etc/haproxy/
vim /etc/haproxy/haproxy.cfg
4 That's ok :log /dev/log local0
5 That's ok :log /dev/log local1 notice
8 That's ok :#chroot /usr/share/haproxy
26 Below row : Delete all
26-30 That's ok : Add node server information
listen webcluster 0.0.0.0:80
option httpchk GET /index.html
balance roundrobin
server inst1 192.168.13.20:80 check inter 2000 fall 3
server inst1 192.168.13.30:80 check inter 2000 fall 3
cp /opt/haproxy-1.5.19/examples/haproxy.init /etc/init.d/haproxy
chmod +x /etc/init.d/haproxy
ln -s /usr/local/sbin/haproxy /usr/sbin/haproxy
service haproxy start
1.2 Node server
systemctl stop firewalld
setenforce 0
yum install httpd -y
echo 'this is web1!' >/var/www/html/index.html
systemctl start httpd
The other server repeats the operation
Two 、 Conclusion
- Be steady , Wrong, take your time
- In the configuration file option httpchk GET /index.html This business , It corresponds to the last default file type of the node server , Must correspond to , Otherwise return to 503
边栏推荐
- 【AtCoder1980】Mysterious Light(数学模拟)
- 【IoT】智能硬件:如何获取硬件产品的wifi信号强度
- 【CodeForces908H】New Year and Boolean Bridges (FWT)
- 学 SQL 必须了解的10个高级概念
- 【Oracle 数据库】奶妈式教程day02 数据库管理工具SQLPLUS的使用
- JVM learning record (VII) -- class loading process and parental delegation model
- Wc2020 course selection
- 2、 User login and registration
- 2020080 simulation competition [horizontal and vertical coordinates do not affect each other, cactus minimum cut, combined meaning translation formula]
- Paper size and book size
猜你喜欢

Implementation of stack (C language)
![[Oracle database] mammy tutorial day03 Sorting Query](/img/ea/24c9495a2ef4f1786f7b7852bde321.png)
[Oracle database] mammy tutorial day03 Sorting Query

2022 low voltage electrician operation certificate test question simulation test platform operation
![[Oracle database] mammy tutorial day02 use of database management tool sqlplus](/img/f2/8f6f74a62427ebfb4c805c1e9b3352.png)
[Oracle database] mammy tutorial day02 use of database management tool sqlplus

Mobile console Gobang (first draft of detailed design)

【Oracle 数据库】奶妈式教程day04 排序查询

Building a full-featured NAS server with raspberry pie (05): playing with video and audio & sorting out movies

测试4年裸辞失业,面试15k的测试岗被按在地上摩擦,结局让我崩溃大哭...

软件测试周刊(第75期):唯有平视,才能看见真实的自己。

Crmeb/v4.4 Standard Version open version mall source code applet official account h5+app mall source code
随机推荐
欧拉定理及扩展(附证明)
【Oracle 数据库】奶妈式教程day04 排序查询
学 SQL 必须了解的10个高级概念
2022年熔化焊接与热切割考试练习题及答案
【AtCoder2376】Black and White Tree(博弈)
【CodeForces908H】New Year and Boolean Bridges (FWT)
Use of wordcloud
20200727 T2 small w playing game [generating function (binomial inversion technique)]
Import on CSDN MD file
Configuration software -- control import
JVM学习记录(七)——类加载过程与双亲委派模型
QObject usage skills -- control function class
自动化测试的生命周期是什么?
二本畢業,銀行外包測試工作 4 個月有餘。聊聊一些真實感受 ...
[STL source code analysis] summary notes (10): hashtable exploration
Sdl-2 thread logic
Uoj 554 [unr 4] challenges Hamilton [find Hamilton path (adjustment method)]
What is the difference between gaussdb for redis and redis?
Uoj 551 [unr 4] campus stroll [good polynomial questions (FOG)]
2020080 simulation competition [horizontal and vertical coordinates do not affect each other, cactus minimum cut, combined meaning translation formula]