我知道在加载服务器,HAroxy(1.4.4)roundrobin不均匀分布,但我的服务器正在获得没有stream量(testing设置),和roundrobin平衡做www1,www1,www1,www1,www1,… WWW2,WWW2,WWW2,…,WWW1 … 我通过让脚本在每个服务器cat / etc / HOSTNAME(slackware)上运行来validation这一点。 我需要每次来回切换testing一些会话内容(存储在共享memcached中),但是在每个请求中无法在两台Web服务器之间切换时遇到问题。 global log 127.0.0.1 local0 warning maxconn 4096 chroot /usr/share/haproxy pidfile /var/run/haproxy.pid uid 99 gid 99 daemon defaults balance roundrobin fullconn 100 maxconn 4096 mode http option dontlognull option http-server-close option forwardfor option redispatch retries 3 timeout connect 5000 timeout client 20000 timeout server 60000 timeout queue […]
我已经通过xinetd使用HAProxy设置了负载平衡MySQL从站 。 2个负载均衡器共享一个由Pacemakerpipe理的虚拟IP: crm configure show : node SVR120-27148.localdomain node SVR255-53192.localdomain primitive failover-ip ocf:heartbeat:IPaddr2 \ params ip="192.168.5.9" cidr_netmask="32" \ op monitor interval="5s" \ meta is-managed="true" primitive haproxy ocf:heartbeat:haproxy \ params conffile="/etc/haproxy/haproxy.cfg" \ op monitor interval="30s" \ meta is-managed="true" colocation haproxy-with-failover-ip inf: haproxy failover-ip order haproxy-after-failover-ip inf: failover-ip haproxy property $id="cib-bootstrap-options" \ dc-version="1.0.12-unknown" \ cluster-infrastructure="openais" \ […]
使用HAProxy 1.6和一个聪明的黑客 ,我现在有一个HAProxy TCP模式前端,检测浏览器是否有能力的SNI,并在此基础上,路由到一个强encryption的SSLterminal后端,或者一个较弱的。 这确保了SSL实验室的A +分级,同时仍允许除IE6以外的所有浏览器使用SSL。 这是我的configuration。 它有一些模板variables应该是不言自明的,但不在与我的问题相关的领域: frontend https_incoming bind 0.0.0.0:443 mode tcp option tcplog tcp-request inspect-delay 5s tcp-request content accept if { req.ssl_hello_type 1 } use_backend https_strong if { req.ssl_sni -m end .transloadit.com } default_backend https_weak backend https_strong mode tcp option tcplog server https_strong 127.0.0.1:1665 frontend https_strong bind 127.0.0.1:1665 ssl crt ${DM_ROOT_DIR}/envs/ssl/haproxy-dh2048.pem no-sslv3 […]
我有两个系统,都是虚拟机。 configuration为使用桥接networking。 我试图让Keepalived来pipe理VIP的所有权 – 10.190.1.230。 我已经尝试了两个版本的keepalived-1.2.2和keepalived-1.2.1,从源头上构build。 ServerA – RHEL5.2 x64 – 10.190.1.228 – PRIORITY 50 ServerB – RHEL6 x64 – 10.190.1.229 – PRIORITY 101 VIP – 10.190.1.230 我的问题似乎在ServerB上keepalived不发送多播广告。 它看到多播广告。 来自ServerA: [root@ServerB~]# tcpdump -vv -c 3 -i eth0 vrrp tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes 10:18:10.760577 IP (tos 0x0, ttl 255, […]
我一直在环顾四周,似乎没有人试图按照我的方式来扩展SSLterminal,我很好奇为什么我的方法似乎很不寻常。 以下是我想要做的以及为什么: 10.0.1.1 10.0.1.2 – 10.0.1.5 —–+——–+—-+—-+—-+ | | | | | +–+–+ +-+-++-+-++-+-++-+-+ | LB1 | | A || B || C || D | +—–+ +—++—++—++—+ haproxy 1.5 haproxy 1.5 + tomcat tcp mode http mode 为什么这个疯狂的设置Internet -> HAProxy (tcp mode) -> HAProxy (http mode) -> Tomcat ? 用两个字来说:安全性和可扩展性 通过将SSLterminal卸载到运行HAProxy 1.5的Web后端(AD)和仅在回送接口上监听的Tomcat,我可以保证所有stream量都从客户端encryption到服务器,而不会从本地到networking的任何事件嗅探后端。 另外,随着SSL需求的增加,我可以简单地在负载均衡器后面增加新的(便宜的)后端服务器。 最后,它消除了将证书置于面向外部的LB上的需求,并且由于受到攻击的LB将不会有任何Pem或证书,从而增加了额外的安全性。 […]
我们有一个用Apache运行的网站。 最近该网站已经看到增加的负载,并作为一个停止的差距,我们要把网站上的所有静态内容转移到无cookie的域名,例如http://static.thedomain.com 。 该应用程序不是很好理解。 所以为了让开发者有时间去修改代码,把它们的链接指向静态内容服务器( http://static.thedomain.com ),我想通过nginx代理这个站点,并且重写这个即将到来的响应,以便到/images/…被重写为http://static.thedomain.com/images/… 例如,在Apache对nginx的响应中,有一些Headers + HTML。 在从Apache返回的HTML中,我们有<img>标签,它们看起来像: <img src="/images/someimage.png" /> 我想将其转换为: <img src="http://static.thedomain.com/images/someimage.png" /> 以便接收到HTML页面的浏览器直接从静态内容服务器请求图像。 这可能与nginx(或HAProxy)? 我对文档进行了粗略的浏览,但除了重写入站url之外,没有任何东西跳出来。
1.5版本中的新function是http-response add-header指令。 正如在文档中所写 – 这可以用在frontend , backend和listen 。 我正在尝试在frontend部分: use_backend some_backend if some_condition http-response add-header Vary Origin if some_condition 但是这没有效果。 放在backend部分的同一行工作得很好。 有人可以帮我理解,我在这里错过了什么? 我不明白,为什么这在frontend部分不起作用。 我的猜测是,在内部没有反应,所以指令失败。 我试着在use_backend指令前后使用它。
在Ubuntu 14.04 x64服务器上,Haproxy使用3.3 GB内存和6.8 GB交换,同时处理52k连接。 在大多数stream量被redirect到另一个haproxy框之前,CPU使用率也保持在100%。 stream量主要是连接的TCP连接。 pid = 3185 (process #1, nbproc = 1) uptime = 0d 6h14m21s system limits: memmax = unlimited; ulimit-n = 524341 maxsock = 524341; maxconn = 262144; maxpipes = 0 current conns = 54303; current pipes = 0/0 Running tasks: 1/54336 有人注意到,在大约50k的连接上,内存使用量猛增。 ulimit -n设置为1048576 。 问题:内存使用量是否exception高? 我们如何减less内存消耗? 我还从另一个问题读了下面的内容,是否相关? 我应该如何检查TCP设置是否足够(对于持续的TCP连接),以免导致内存使用量的巨大增加? […]
使用HAProxy,我想创build以下设置: 除root(/),/ articles和/ blog之外的所有请求都会转到server1 对根(/),/文章和/博客的所有请求都转到server2 我无法弄清楚如何匹配根,而不依赖于设置默认的服务器,然后否定所有的请求去server1规则。 我如何使用HAProxy来expression上述内容? 一个正则expression式可能是解决这个问题的方法,但是我对正则expression式并不擅长,所以很难提出一个基于它的解决scheme。
我的单个主机上有多个游戏服务器TCP端口。 目标是让用户能够连接到server1.domain.net,并根据该子域名进行定向。 我的第一本能写了下面的内容,但后来我意识到,TCPstream量不会有任何头来读取。 使用HAProxy 1.5.8。 我尝试使用多个后端,use_backend和完整的ACL线做同样的事情,但得到了相同的结果(可以理解)。 listen game-listener bind xxxx:22222 mode tcp use-server server1 if { hdr(host) -i server1.domain.net } use-server server2 if { hdr(host) -i server2.domain.net } server server1 localhost:22201 check server server2 localhost:22202 check 是否有像我可以用于TCP连接的hdr(主机)检查? 还是我做对了,游戏只是不好玩? 谢谢!