如何用HAProxy代理GlusterFS?

Load balancing

1 前言

一个问题,一篇文章,一出故事。
笔者今天需要实现HAProxy代理sftp,因此整理此文。

2 最佳实践

2.1 实践环境

HAProxy集群环境,

如何使用HAProxy配置PostFix集群?


GlusterFS服务环境,

如何管理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/

没有评论

发表回复

Load balancing
如何实现HAProxy集群多节点私有配置?

1 前言 一个问题,一篇文章,一出故事。 笔者之前创建的HAProxy集群(基于3层路由,即任播技术 …

Load balancing
如何设置haproxy节点异常邮件通知?

1 前言 一个问题,一篇文章,一出故事。 笔者haproxy上代理的节点越来越多,因此被haprox …

Load balancing
如何配置HAProxy的状态统计页面?

1 前言 一个问题,一篇文章,一出故事。 笔者今天想通过http的web页面查看haproxy的服务 …