情况: 我想这个工作:请求来自客户端,通过443端口(ssl)去haproxy,然后它必须去80端口的后端。 我有中间ca(ca1),ca1证书和客户端证书给出的服务器证书。 但我没有find解决scheme,请求从Windows证书颁发机构正确的服务器证书haproxy服务器(Ubuntu的)。 可能是模板的原因。 我要求从Windows机器服务器证书,并将其复制到haproxy。 和问题是HAProxy日志有这个错误“SSL客户端CA链无法validation” configurationhaproxy: 前端https_frontend bind 192.168.14.167:443 ssl crt /etc/haproxy/cert/request/server.pem ca -file /etc/haproxy/cert/request/ca1-certificate.pemvalidation可选的crt-ignore-err全部no-sslv3 模式http 日志/ dev / log local7 选项httplog use_backend web_server_1 if {ssl_fc_has_crt} default_backend web_server_2 后端web_server_1 模式http 选项httplog 服务器w7 192.168.11.109:80检查 后端web_server_2 模式http 选项httplog 服务器xp 192.168.13.205:80检查 这个scheme不起作用。 附加信息:从winXP,我运行opennssl的日志 C:\ OpenSSL-Win32 \ bin> openssl s_client -connect haproxy2:443 -cert client.pem -CAfile ca1-certificate.pem -state […]
在本指南中,我不关注设置HA代理或为什么要这样做。 如果你有它,并且想要使用Icinga来正确地监控它,那么下面是你如何去做这件事的一个想法。 所以这是一个潜在的情况: 2个数据中心A和B. 每个数据中心1个HA代理节点 每个HA代理指向每个数据中心A1,A2,B1,B2中的2个Web服务器 这个场景中的Web服务器实际上是一个Web服务端点,并且一个简单的HTTP GET到URL并不能告诉你有关系统的实际健康状况 监测明智的你可以解决你的当前活动节点的外部检查(如pingdom或其他)。 这将有一些影响,虽然: 你不会testing被动节点,这意味着在节点切换之前,你不确定被动节点是否工作 一个节点的失败不会给你一个明确的错误指示 所以这里是一个偏执的人的方法: 我想从外部IP(s),通过HA代理一直监视每个节点,并进入系统捕捉任何故障 我想要对后端服务进行实际的Web服务调用,以validation它是否正常工作 – 如果您正在testing一个正常的Web站点,显然不适用 让我们开始吧
我在Ubuntu 14.04 LTS上使用以下指南设置Corosync / Pacemaker集群+ HAproxy: http : //www.sebastien-han.fr/blog/2012/04/15/active-passive-failover-cluster-on-a-的MySQL-加莱拉群集与- HAProxy的-LSB剂/ 我没有添加虚拟IP设置,只有两个节点,都安装了Haproxy。 我正在使用lsb:haproxy,我的configuration如下: 为了testing一切,我运行以下命令来终止haproxy进程:sudo kill -9 [PID#] 然后,我检查群集的状态并收到以下错误消息:“失败的操作:权限不足”。 我没有更改haproxy用户/组定义,我的aisexec {}对用户和组都使用root。 如果我想让Corosync / Pacemakerpipe理Haproxy,我的权限应该是什么? 编辑:当我运行下面的服务停止命令,haproxy按预期重新启动。 检查crm status haproxy守护进程正常运行 # sudo service haproxy stop # sudo crm status HaproxyHA (lsb:haproxy): Started node1 Failed Actions: 但是当我手动杀死pid时,我一直看到错误: # sudo kill -9 $PID HaproxyHA (lsb:haproxy): Started node1 (unmanaged) FAILED Failed Actions: […]
我正在configurationHAProxy将httpredirect到https,但似乎不起作用。 我使用的configuration是: /etc/hosts内容 127.0.0.1 example.com Haproxyconfiguration frontend http mode http bind :80 bind :443 ssl crt /etc/ssl/ redirect scheme https if !{ ssl_fc } default_backend my_backend 用curltesting给出这个错误 $ curl https://example.com < this works $ curl http://example.com > curl: (7) Failed to connect to 2400:cb00:2048:1::681c:a20: No route to host 但是,命令lsof已经输出 $ sudo lsof -i :80 | […]
我有点HAProxy新手 – 我有3个docker集装箱,一个运行HAProxy与以下configuration: global log 127.0.0.1 local0 log 127.0.0.1 local1 notice chroot /var/lib/haproxy user haproxy group haproxy stats socket /var/run/haproxy.sock mode 600 level admin # daemon defaults log global mode http option httplog option dontlognull timeout connect 5000ms timeout client 50000ms timeout server 50000ms balance source listen stats :80 stats enable stats uri /haproxy?stats stats […]
我想知道是否有办法在haproxy中configuration一个默认的后端,所以它平衡了后端服务器池中的请求(在下面的例子中是三个),保持默认的后端作为一个故障转移,只有在三个主后端closures的情况下 。 它应该是这样的: server backend-0 10.10.10.0:3000 check server backend-1 10.10.10.1:3100 check server backend-2 10.10.10.2:3200 check server backend-default 10.10.10.3:3300 check 我已经尝试在后端默认设置weight 0 ,但是完全从平衡algorithm中删除服务器。
我正在Caucho Resin后端工作,在专用服务器上configurationHAproxy。 现在我正在处理file upload问题。 我们的networking应用程序允许file upload的图像,如果我直接打到我的一个Resin服务器,上传速度非常快(5秒),没有任何问题。 然后,当我通过我的生产负载平衡器时,图像上传是超级缓慢(50/60秒)。 我已经调整了负载平衡器的sysctl.conf以获得更多的TCP socket的内存 net.core.rmem_max = 134217728 net.core.wmem_max = 134217728 net.ipv4.tcp_rmem = 4096 87380 67108864 net.ipv4.tcp_wmem = 4096 65536 67108864 net.core.netdev_max_backlog = 250000 fs.file-max = 100000 但没有看到任何改善,所以我拿了另一台服务器,并安装HAproxy与我的运行configuration和在sysctl文件相同的调整,然后我做了相同的上传testing和上传速度是相当不错的,大约6秒钟完成请求。 所以,我的haproxyconfiguration文件没有问题,在后端服务器没有问题。 由于这第二个服务器是一个没有stream量的备用服务器,我知道我的sysctl调优在我的生产负载平衡器上不够好。 一切工作正常(正常的网页浏览等) 负载平衡器是戴尔R415与英特尔82576千兆网卡,运行HAPROxy 1.5.9。 我可以帮我调整我的sysctl.conf吗? 谢谢
使用HAProxy 1.5,是否可以添加一个请求头,其值是绑定使用通配符的前端使用的IP地址? 例如,给定以下configuration,是否有我replace“%[fe_id]”与为了得到用于连接到前端的variablesIP地址? frontend localhost bind *:80 bind *:443 ssl crt /etc/ssl/ssl.pem mode http default_backend nodes option forwardfor backend nodes mode http balance roundrobin http-request add-header X-FrontEnd-IP %[fe_id] server web00 10.1.10.15:80 check server web01 10.1.10.16:80 check server web02 10.1.10.17:80 check
我们在Amazon EC2实例中使用HA代理将某些请求路由到两个不同的EC2 ELB(弹性负载均衡器)的内部负载均衡器。 这是HA代理configuration: defaults mode http log global no option redispatch retries 25 timeout connect 10000 # default 10 second time out if a backend is not found timeout client 30000 timeout server 30000 maxconn 20000 stats uri /haproxy?stats option http-server-close timeout http-request 100s timeout http-keep-alive 124s backend main-service-backend option httpchk GET /ping server […]
我试图让HAProxyredirect到正确的URI的情况下,请求的URI是非www或非https。 我正在装入的问题是,它重新定向,只要它击中一条线,导致多个redirect。 这是我的configuration: *snip* frontend traffic-in bind *:80 bind *:443 ssl crt /etc/haproxy/certificate.bundled.pem reqrep ^(.*)[^/]$ \1/ redirect prefix https://www.example.com 301 if { hdr(host) -i beste.nl } redirect scheme https code 301 if !{ ssl_fc } *snip* 如果我要访问http://example.com ,首先会将我redirect到http://example.com/ ,然后是https://www.example.com 。 我希望它redirect一次,而不是几次,因为这会损害我们的Google排名。 我怎么能redirect请求到一个URI的尾部的斜杠AND ssl?