Articles of haproxy

HAProxy的-sf选项不适合我

我在RedHat 5.5上使用HAProxy并具有下面的configuration。 global daemon maxconn 1024 log 127.0.0.1 local1 info defaults log global balance roundrobin mode http retries 3 option redispatch timeout connect 300000ms timeout client 300000ms timeout server 300000ms listen epgs bind *:80 server server1 127.0.0.1:8080 maxconn 1 check server server2 epg.local.com:8080 maxconn 1 check stats uri /stats 我开始使用JMeter向HAProxy发出5000个请求。 当JMeter发出请求时,我从configuration文件中删除了server2,并激活了“haproxy -f /etc/haproxy.cfg -p /var/run/haproxy.pid […]

Nginx / haproxy / IIS – configuration问题和疑虑

我们的环境主要由在IIS / ASP.Net上运行的SSL网站组成。 大多数网站代码是报告,分析和用户特定的数据视图。 我们正在扩大并发用户的数量,我需要规划故障切换和集群能力。 我一直在研究设置nginx和haproxy以及可能的清漆来处理SSL卸载,负载平衡和caching。 我的一个问题涉及到configuration。 我相信,从我所读到的,由于我们运行的SSL站点,nginx需要在清漆面前。 我设想适当的设置是: * ——- * * nginx * * ——- * | * ——— * *清漆* * ——— * | * ——— * * haproxy * * ——— * | \ | – – – – – | | * —— * * —— * * web1 * […]

HAProxy之前的清漆似乎重用(错误的)后端连接

我们有以下设置:Nginx – > Varnish – > HAProxy – > App Server A / App Server B. 我们处理的大多数请求都是由HAProxy代理到App Server A.这是基于主机头值完成的。 一些主机应该被redirect到App Server B.到App Server B的stream量非常低。 大多数请求工作正常。 每隔一段时间请求应该代理到应用程序服务器B给出一个404状态代码。 这些请求显示在Nginx,Varnish和App Server A的日志中,但不是HAProxy。 请求正常工作的应用程序服务器A和B由HAProxy正确logging。 看起来Varnish重用连接到由HAProxybuild立的App Server A,阻止这些请求被重新评估并发送到适当的后端。 这是我的问题的一个似是而非的原因? 有没有办法强制Varnish重新连接到后端,或HAProxy留在这些服务器之间? 每种解决scheme的优点/缺点是什么? 谢谢! 编辑: 这是我的Varnish日志文件的一部分: 12 SessionClose c Connection: close 12 StatSess c 127.0.0.1 54331 0 1 1 0 0 1 […]

haproxy头重写为小写

我有一个haproxy服务器后面的自定义应用程序。 haproxy可以重写头部的情况吗? 例如,将http://www.company.com/ABC更改为http://www.company.com/abc 如果是这样,怎么样?

Nginx + SSL + Rails + Juggernaut(Node.js)+ Engineyard

我在同一台服务器上有两个不同的应用程序。 其中一个在80端口(mydomain.com)上运行,另一个在端口443(sub.mydomain.com)上运行,并具有通配符证书。 第一个应用程序仅用于信息目的,不需要websockets支持。 第二个应用程序应该有安全的websockets支持(wss协议)。 我尝试在engineyard云上为我的rails应用程序和nginx服务器设置juggernaut gem(用于websockets),但是我遇到了一个问题。 Engineyard云只提供两个打开的端口:80和443.我知道nginx并不完全支持http 1.1反向代理,所以我不能使用nginx中的代理redirectwebsockets请求到特定的本地端口(在我的情况下,这个端口是8080)。 我试过使用HAProxy,它对我来说只是使用不安全的websocket,但是我需要支持安全的websocket。 正如我所知,在这种情况下,我应该使用像隧道隧道我的https请求,而不是使用HAProxy,但是当我testing它 – 我看到服务器必须工作几次慢,我仍然没有工作,使用安全套接字连接:( 也许我做错了什么? 也许有人会告诉如何为多个应用程序设置nginx(其中一个应该通过https工作),并使用两个端口(80和443)来保护websocket。 ps另外我用了一个node-http-proxy,在这种情况下,我可以为不同的nginx应用程序设置代理,但是我不能运行websockets(只发生在通过nginx的“handshake”上,而不是“切换协议”)

我的redirect有什么问题?

我需要haproxy将product.company.comredirect到company.com/about/product acl newproduct hdr(host) –i product.company.com redirect location http://company.com/about/product if newproduct 我知道我打了服务器,但它永远不会redirect。 我试过hdr_beg(主机)产品,并没有工作。 我错过了什么?

HAProxy小时,一天,一周logging

有没有一种方法可以从HAProxy中获得类似于WebAlizer的统计信息,这样我就可以看到stream量的大小 – 历史上 – 哪个命中我的HAProxy服务器? 谢谢!

负载平衡,主动 – 主动configuration和dynamic服务器添加

对。 我正在考虑设置一个这样的系统: / [Load Balancer] \ / \ / \ / \ / \ / \ / \ / \ [LAN1] – —– | 服务器池| \ [Load Balancer] / \ / \ / \ / \ / \ / \ / \ / | [冗余] [负载平衡器] 在这种设置中,负载平衡器的主动 – 主动configuration(以确保没有单点故障)以及池中可变数量的Web服务器。 服务器可以随时build立并运行(通过networking引导),所以平衡器应该能够将这些服务器添加到后端, 而无需重新启动服务。 正如你可以告诉我很清楚问题是什么,但我不知道如何实现它。 我在想: 1)在这种情况下,哪个负载均衡器最适合? 到目前为止我研究过的是HAProxy,Linux虚拟服务器,Ultramonkey和XR十字路口。 […]

在HAproxy服务器中dynamic添加节点时出现意外的行为

我想为我的Web应用程序使用HAProxy进行负载平衡。 我正在尝试在HAProxy服务器中使用命令dynamic添加一个新的rabbitmq节点: haproxy -p /var/run/haproxy.pid -sf $(cat /var/run/haproxy.pid) 。 我正在使用leastconn不平衡algorithm进行负载均衡的tcp连接模式。 预计什么时候在一个rabbitmq中有3个连接,我在HAProxy服务器上添加一个新的兔子服务器。 所以下一个连接将传递到第二个rabbitmq服务器,这是不是在我的情况发生。 它以随意的方式分配连接。 这是我的configuration文件: defaults log global mode http option httplog option dontlognull retries 3 option redispatch maxconn 2000 contimeout 5000 clitimeout 5000 srvtimeout 5000 listen rabbitmq 0.0.0.0:5672 mode tcp stats enable balance leastconn option tcplog server rabbit01 xx.xx.xx.xx:5672 check server rabbit02 xx.xx.xx.xx:5672 check listen […]

跟踪应用程序正在经历的HAproxy

我有这样的设置,其中几个应用程序正在通过负载平衡器(HAproxy)并访问MySQL数据库。 Several applications -> HAproxy -> MySQL database 我想知道哪个特定的应用程序正在访问数据库。 当我在数据库上做了一个show processlist时,它显示了HAproxy的IP(当然)。 然后我试图在haproxy和mysql数据库上做lsof,但是它并没有帮助我(或者我不知道如何正确解释结果)。 最后我检查了haproxy日志,但没有显示任何东西。 谢谢。