Load Balancing OpenSSH SFTP with HAProxy
In this post I am going to describe how I have load balanced 2 SFTP servers using HAProxy.
I will assume that we have 2 sftp Ubuntu servers with IP addresses of 192.168.10.1 & 192.168.10.2
We then need to spin up a new Ubunutu server and install the HAProxy package. This new server should have 2 NICs installed, one for management of the server and another for load balancing the SSH (port 22) connection. I should note here that I am using VMWare VM's for all of this work. In this example the management IP will be 192.168.10.100 and the IP address for the load balancing will be 192.168.10.50
apt-get install haproxy
once haproxy is installed there are a few configuration changes that need to be made for this to work. The first is in /etc/ssh/sshd_config where we need to ensure the ListenAddress is set to the management IP of 192.168.10.100 - if this is left at the default of 0.0.0.0 haproxy will not be able to bind to port 22.
sudo vi /etc/ssh/sshd_config
ListenAddress 192.168.10.100
We also need to enable haproxy so that it starts automatically by editing the file shown below and ensuring 'Enabled' is set to 1
sudo vi /etc/default/haproxy
Enabled=1
Now we need to configure haproxy, edit the /etc/haproxy/haproxy.cfg file. I do this by deleting all content of this file and replacing it with my own, delete all content and then paste in the content shown below
sudo vi /etc/haproxy/haproxy.cfg
# config needs haproxy-1.1.28 or haproxy-1.2.1
<wiz_tmp_tag id="wiz-table-range-border" contenteditable="false" style="display: none;">
Load Balancing OpenSSH SFTP with HAProxy的更多相关文章
- 【架构】How To Use HAProxy to Set Up MySQL Load Balancing
How To Use HAProxy to Set Up MySQL Load Balancing Dec 2, 2013 MySQL, Scaling, Server Optimization U ...
- Installing haproxy load balancing for http and https--转载
This example will guide you through a simple IP based load balancing solution that handles ssl traff ...
- 负载均衡(Load Balancing)学习笔记(二)
概述 文章负载均衡(Load Balancing)学习笔记(一) 讲述了负载均衡的一般性原理,本文继续介绍常见的实现负载均衡的方法. HTTP重定向 HTTP重定向服务器是一台普通的Web服务器,用户 ...
- 负载均衡(Load Balancing)学习笔记(一)
概述 在分布式系统中,负载均衡(Load Balancing)是一种将任务分派到多个服务端进程的方法.例如,将一个HTTP请求派发到实际的Web服务器中执行的过程就涉及负载均衡的实现.一个HTTP请求 ...
- Elastic Load Balancing with Sticky Sessions
Elastic Load Balancing with Sticky Sessions — Shlomo Swidler https://shlomoswidler.com/2010/04/elast ...
- gRPC Load Balancing
gRPC Load Balancing 翻译自:https://grpc.io/blog/grpc-load-balancing/ 这是gRPC负载均衡的第一篇,后续会给出基于golang XDS服务 ...
- CF# Educational Codeforces Round 3 C. Load Balancing
C. Load Balancing time limit per test 2 seconds memory limit per test 256 megabytes input standard i ...
- Codeforces Educational Codeforces Round 3 C. Load Balancing 贪心
C. Load Balancing 题目连接: http://www.codeforces.com/contest/609/problem/C Description In the school co ...
- UVA 12904 Load Balancing 暴力
Load Balancing Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/vi ...
随机推荐
- XML(二)
XML XML介绍 1.什么是xml? 概念:XML(EXtensible Markup Language)XML 指可扩展标记语言(EXtensible Markup Language) 可扩展:我 ...
- DRF的分页
DRF的分页 DRF的分页 为什么要使用分页 其实这个不说大家都知道,大家写项目的时候也是一定会用的, 我们数据库有几千万条数据,这些数据需要展示,我们不可能直接从数据库把数据全部读取出来, 这样 ...
- 《Python》 计算机基础
一.计算机基础: cpu:中央处理器,相当于人的大脑,运算中心,控制中心. 内存:暂时存储数据,与CPU交互. 优点:内存读取速度快. 缺点:容量小,造价高,断电即消失. 硬盘:长期存储数据. 优点: ...
- 关于iOS构建版本
1.Build Active Architecture Only 设置 Build Active Architecture Only 设置为NO的时候,会编译支持的所有的版本 设置为YES的时候,是为 ...
- jdk8-Optional类
概念: package com.atguigu.java8; import java.util.Optional; import org.junit.Test; /* * 一.Optional 容器类 ...
- python获取代理IP
利用requests库获取代理,用Beautiful库解析网页筛选ip # -*- coding: utf- -*- import requests from bs4 import Beautiful ...
- lvs的FULLNAT
- mail命令入门及进阶
mail是linux shell中的邮件工具,与crontab配合使用,可以实现定期发送邮件.本文主要介绍mail工具使用方法及注意事项. 1.mail命令一般用法: mail –s "邮件 ...
- 《统计学习方法》笔记(9):EM算法和隐马尔科夫模型
EM也称期望极大算法(Expectation Maximization),是一种用来对含有隐含变量的概率模型进行极大似然估计的迭代算法.该算法可应用于隐马尔科夫模型的参数估计. 1.含有隐含参数的概率 ...
- python day09作业