如何用HAProxy代理GlusterFS?
- By : Will
- Category : Load balancing
1 前言
一个问题,一篇文章,一出故事。
笔者今天需要实现HAProxy代理sftp,因此整理此文。
2 最佳实践
2.1 实践环境
HAProxy集群环境,
GlusterFS服务环境,
2.2 配置代理
2.2.1 修改配置文件
vim /etc/haproxy/conf.d/gluster.cmdschool.org_24007_glusterd.cfg
加入如下配置,
frontend glusterfs bind *:24007 mode tcp timeout client 1m log global default_backend glusterfs_servers backend glusterfs_servers mode tcp log global timeout server 1m timeout connect 5s balance roundrobin server gfs01 10.168.0.211:24007 check server gfs02 10.168.0.212:24007 check server gfs03 10.168.0.213:24007 check server gfs04 10.168.0.214:24007 check server gfs05 10.168.0.215:24007 check
2.2.2 检查配置
haproxy -c -f /etc/haproxy/conf.d
2.2.3 应用配置
systemctl reload haproxy.service systemctl status haproxy.service
2.3 客户端挂载
mount -t glusterfs gluster.cmdschool.org:/volume1 /mnt
参阅文档
======================
https://www.mail-archive.com/haproxy@formilux.org/msg23817.html
https://haproxy.formilux.narkive.com/EpMmLH3G/for-sftp-load-balancing
https://www.cnblogs.com/rongfengliang/p/10319205.html
https://jakec007.github.io/2021-03-09-load-balancing-ssh-with-haproxy/
https://docs.haproxy.org/2.2/configuration.html
https://www.haproxy.com/documentation/haproxy-configuration-tutorials/session-persistence/
https://www.haproxy.com/documentation/haproxy-configuration-tutorials/load-balancing/passive-ftp/
没有评论