这是我想要完成的设置

所以,我试图完成的是:一个用户去10.0.0.1它传递给任何负载均衡pipe理请求。 然后我想要清漆实际上处理请求。
这是我的ha.cf文件:
debug 3 debugfile /var/log/ha-debug logfile /var/log/ha-log bcast eth0 keepalive 2 warntime 5 deadtime 15 initdead 30 udpport 694 udp eth0 auto_failback yes node loadb1 node loadb2
*这在loadb2上是一样的。 另外我有debugging启用testing的目的。 在生产准备就绪时将被删除。
这里是haresources
loadb1 IPaddr::10.0.11.200/32 varnishd
*同样,在loadb2(我也试图这样做,使心跳不能pipe理除IP以外的任何东西,所以没有“varnishd”在最后的haresources)
我的清漆configuration如下:
backend server1 { .host = "10.5.0.111"; .probe = { .url = "/"; .interval = 5s; .timeout = 1 s; .window = 5; .threshold = 3; } } backend server2 { .host = "10.5.0.112"; .probe = { .url = "/"; .interval = 5s; .timeout = 1 s; .window = 5; .threshold = 3; } } director example_director random { { .backend = server1; .weight = 2; } { .backend = server2; .weight = 1; } } sub vcl_recv { if (req.http.host ~ "^(www.)?bps101.net$") { set req.backend = example_director; } }
我的心跳正常。 IP 10.0.0.1完全可以ping通。 但是,当我在浏览器中10.0.0.1时,我得到一个连接重置。 (没有任何东西正在听80端口)。 我知道清漆configuration的作品。 我知道心跳configuration的作品。 我不能让他们一起工作。 有没有人有任何build议或想法? 任何人都可以提供的build议,方向等,我将不胜感激。 谢谢。
你可以在resources.d下创build自己的脚本,以便心跳可以pipe理清漆deamon。
一个简单的解决scheme将是
#!/bin/bash case $1 in start) /etc/init.d/varnish start ;; stop) /etc/init.d/varnish stop ;; status) ;; esac
你可以在http://foobar.lamp-solutions.de/howtos/lamp-administration/tuning/tuning-einzelansicht/archive/2011/may/article/hoechverfuegbarer-http-loadbalancer-mit-下find德语的小手册。 清漆-UND-心跳的Unter-Ubuntu的1004.html
好的,基本的:
ip ad show ) netstat -tanp ) 如果这两个是正确的,一些怪物正在发生:)我使用类似的解决scheme,你我可以用这个答案描述你可以使用相同的东西,只使用1个IP来达到你想要的效果。
是的。 问题似乎是我的心跳haresourcesconfiguration需要没有“varnishd”在其中。 无论出于何种原因,心跳都会痛恨这一点。 所以心跳不完全pipe理清漆。 但我有cronjob运行脚本来查看清漆是否正在运行。 如果不是,请重新启动它。