以调试模式对ldirectord进行调试,有问题,权值全变为0

ldirectord的配置如下:
checktimeout=3
checkinterval=1
fallback=127.0.0.1:80
autoreload=yes
logfile="/var/log/ldirectord.log"
#logfile="local0"
quiescent=yes

# A sample virual with a fallback that will override the gobal setting
virtual=192.168.1.200:80
real=192.168.1.175:80 gate
real=192.168.1.176:80 gate
real=192.168.1.252:80 gate
# real=192.168.6.6:80 gate
fallback=127.0.0.1:80 gate
service=http
request="index.html"
receive="Test Page"
virtualhost=loadbalancer
scheduler=rr
#persistent=600
#netmask=255.255.255.255
protocol=tcp
通过ldirectord -d /etc/ha.d/ldirectord.cf start进行调试,结果如下:
DEBUG2: Running exec(/usr/sbin/ldirectord -d /etc/ha.d/ldirectord.cf start)
Running exec(/usr/sbin/ldirectord -d /etc/ha.d/ldirectord.cf start)
DEBUG2: Invoking ldirectord invoked as: /usr/sbin/ldirectord /etc/ha.d/ldirectord.cf start
Invoking ldirectord invoked as: /usr/sbin/ldirectord /etc/ha.d/ldirectord.cf start
DEBUG2: Starting Linux Director v1.141 with pid: 5893
Starting Linux Director v1.141 with pid: 5893
DEBUG2: Running system(/sbin/ipvsadm -A -t 192.168.1.200:80 -s rr )
Running system(/sbin/ipvsadm -A -t 192.168.1.200:80 -s rr )
DEBUG2: Added virtual server: 192.168.1.200:80
Added virtual server: 192.168.1.200:80
DEBUG2: Running system(/sbin/ipvsadm -a -t 192.168.1.200:80 -r 127.0.0.1:80 -g -w 1)
Running system(/sbin/ipvsadm -a -t 192.168.1.200:80 -r 127.0.0.1:80 -g -w 1)
DEBUG2: Added fallback server: 127.0.0.1:80 ( x 192.168.1.200:80) (Weight set to 1)
Added fallback server: 127.0.0.1:80 ( x 192.168.1.200:80) (Weight set to 1)
No recipient addresses found in header
DEBUG2: Running system(/sbin/ipvsadm -a -t 192.168.1.200:80 -r 192.168.1.252:80 -g -w 0)
Running system(/sbin/ipvsadm -a -t 192.168.1.200:80 -r 192.168.1.252:80 -g -w 0)
DEBUG2: Quiescent real server: 192.168.1.252:80 ( x 192.168.1.200:80) (Weight set to 0)
Quiescent real server: 192.168.1.252:80 ( x 192.168.1.200:80) (Weight set to 0)
No recipient addresses found in header
DEBUG2: Disabled server=192.168.1.252
DEBUG2: Running system(/sbin/ipvsadm -a -t 192.168.1.200:80 -r 192.168.1.176:80 -g -w 0)
Running system(/sbin/ipvsadm -a -t 192.168.1.200:80 -r 192.168.1.176:80 -g -w 0)
DEBUG2: Quiescent real server: 192.168.1.176:80 ( x 192.168.1.200:80) (Weight set to 0)
Quiescent real server: 192.168.1.176:80 ( x 192.168.1.200:80) (Weight set to 0)
No recipient addresses found in header
DEBUG2: Disabled server=192.168.1.176
DEBUG2: Running system(/sbin/ipvsadm -a -t 192.168.1.200:80 -r 192.168.1.175:80 -g -w 0)
Running system(/sbin/ipvsadm -a -t 192.168.1.200:80 -r 192.168.1.175:80 -g -w 0)
DEBUG2: Quiescent real server: 192.168.1.175:80 ( x 192.168.1.200:80) (Weight set to 0)
Quiescent real server: 192.168.1.175:80 ( x 192.168.1.200:80) (Weight set to 0)
No recipient addresses found in header
DEBUG2: Disabled server=192.168.1.175
DEBUG2: Checking negotiate: real server=negotiate:http:tcp:192.168.1.175:80:loadbalancer:::\/index\.html:Test\ Page (virtual=tcp:192.168.1.200:80)
DEBUG2: check_http: url="http://192.168.1.175:80/index.html" virtualhost="loadbalancer"
LWP::UserAgent::new: ()
LWP::UserAgent::request: ()
LWP::UserAgent::send_request: GET http://192.168.1.175:80/index.html
LWP::UserAgent::_need_proxy: Not proxied
LWP::Protocol::http::request: ()
LWP::UserAgent::request: Simple response: Internal Server Error
DEBUG2: Disabled server=192.168.1.175
DEBUG3: Headers Content-Type: text/plain
Client-Date: Wed, 18 Oct 2006 07:43:11 GMT
Client-Warning: Internal response
DEBUG2: check_http: http://192.168.1.175:80/index.html is down
DEBUG2: Checking negotiate: real server=negotiate:http:tcp:192.168.1.176:80:loadbalancer:::\/index\.html:Test\ Page (virtual=tcp:192.168.1.200:80)
DEBUG2: check_http: url="http://192.168.1.176:80/index.html" virtualhost="loadbalancer"
LWP::UserAgent::new: ()
LWP::UserAgent::request: ()
LWP::UserAgent::send_request: GET http://192.168.1.176:80/index.html
LWP::UserAgent::_need_proxy: Not proxied
LWP::Protocol::http::request: ()
LWP::Protocol::collect: read 9 bytes
LWP::UserAgent::request: Simple response: OK
DEBUG2: Disabled server=192.168.1.176
DEBUG3: Headers Connection: close
Date: Wed, 18 Oct 2006 16:21:55 GMT
Accept-Ranges: bytes
ETag: "13194e-9-b6ef3c0"
Server: Apache/2.0.59 (Unix) PHP/5.1.4
Content-Length: 9
Content-Type: text/html
Last-Modified: Wed, 18 Oct 2006 14:54:15 GMT
Client-Date: Wed, 18 Oct 2006 07:43:11 GMT
Client-Peer: 192.168.1.176:80
Client-Response-Num: 1
DEBUG2: check_http: http://192.168.1.176:80/index.html is down
DEBUG2: Checking negotiate: real server=negotiate:http:tcp:192.168.1.252:80:loadbalancer:::\/index\.html:Test\ Page (virtual=tcp:192.168.1.200:80)
DEBUG2: check_http: url="http://192.168.1.252:80/index.html" virtualhost="loadbalancer"
LWP::UserAgent::new: ()
LWP::UserAgent::request: ()
LWP::UserAgent::send_request: GET http://192.168.1.252:80/index.html
LWP::UserAgent::_need_proxy: Not proxied
LWP::Protocol::http::request: ()
LWP::Protocol::collect: read 13 bytes
LWP::UserAgent::request: Simple response: OK
DEBUG2: Disabled server=192.168.1.252
DEBUG3: Headers Connection: close
Date: Wed, 18 Oct 2006 15:25:14 GMT
Accept-Ranges: bytes
ETag: "444d02-d-aec5f740"
Server: Apache/2.0.58 (Unix) PHP/5.1.4
Content-Length: 13
Content-Type: text/html
Last-Modified: Wed, 11 Oct 2006 15:26:45 GMT
Client-Date: Wed, 18 Oct 2006 07:43:11 GMT
Client-Peer: 192.168.1.252:80
Client-Response-Num: 1
DEBUG2: check_http: http://192.168.1.252:80/index.html is down
No recipient addresses found in header
No recipient addresses found in header
No recipient addresses found in header
DEBUG2: Checking negotiate: real server=negotiate:http:tcp:192.168.1.175:80:loadbalancer:::\/index\.html:Test\ Page (virtual=tcp:192.168.1.200:80)
DEBUG2: check_http: url="http://192.168.1.175:80/index.html" virtualhost="loadbalancer"
LWP::UserAgent::new: ()
LWP::UserAgent::request: ()
LWP::UserAgent::send_request: GET http://192.168.1.175:80/index.html
LWP::UserAgent::_need_proxy: Not proxied
LWP::Protocol::http::request: ()
LWP::UserAgent::request: Simple response: Internal Server Error
DEBUG2: Disabled server=192.168.1.175
DEBUG3: Headers Content-Type: text/plain
Client-Date: Wed, 18 Oct 2006 07:46:16 GMT
Client-Warning: Internal response
DEBUG2: check_http: http://192.168.1.175:80/index.html is down
DEBUG2: Checking negotiate: real server=negotiate:http:tcp:192.168.1.176:80:loadbalancer:::\/index\.html:Test\ Page (virtual=tcp:192.168.1.200:80)
DEBUG2: check_http: url="http://192.168.1.176:80/index.html" virtualhost="loadbalancer"
LWP::UserAgent::new: ()
LWP::UserAgent::request: ()
LWP::UserAgent::send_request: GET http://192.168.1.176:80/index.html
LWP::UserAgent::_need_proxy: Not proxied
LWP::Protocol::http::request: ()
LWP::Protocol::collect: read 9 bytes
LWP::UserAgent::request: Simple response: OK
DEBUG2: Disabled server=192.168.1.176
DEBUG3: Headers Connection: close
Date: Wed, 18 Oct 2006 16:24:55 GMT
Accept-Ranges: bytes
ETag: "13194e-9-b6ef3c0"
Server: Apache/2.0.59 (Unix) PHP/5.1.4
Content-Length: 9
Content-Type: text/html
Last-Modified: Wed, 18 Oct 2006 14:54:15 GMT
Client-Date: Wed, 18 Oct 2006 07:46:16 GMT
Client-Peer: 192.168.1.176:80
Client-Response-Num: 1
DEBUG2: check_http: http://192.168.1.176:80/index.html is down
DEBUG2: Checking negotiate: real server=negotiate:http:tcp:192.168.1.252:80:loadbalancer:::\/index\.html:Test\ Page (virtual=tcp:192.168.1.200:80)
DEBUG2: check_http: url="http://192.168.1.252:80/index.html" virtualhost="loadbalancer"
LWP::UserAgent::new: ()
LWP::UserAgent::request: ()
LWP::UserAgent::send_request: GET http://192.168.1.252:80/index.html
LWP::UserAgent::_need_proxy: Not proxied
LWP::Protocol::http::request: ()
LWP::Protocol::collect: read 13 bytes
LWP::UserAgent::request: Simple response: OK
DEBUG2: Disabled server=192.168.1.252
DEBUG3: Headers Connection: close
Date: Wed, 18 Oct 2006 15:28:19 GMT
Accept-Ranges: bytes
ETag: "444d02-d-aec5f740"
Server: Apache/2.0.58 (Unix) PHP/5.1.4
Content-Length: 13
Content-Type: text/html
Last-Modified: Wed, 11 Oct 2006 15:26:45 GMT
Client-Date: Wed, 18 Oct 2006 07:46:16 GMT
Client-Peer: 192.168.1.252:80
Client-Response-Num: 1
DEBUG2: check_http: http://192.168.1.252:80/index.html is down
No recipient addresses found in header

其中直接访问http://192.168.1.252:80/index.html或http://192.168.1.175:80/index.html都是可以访问的,请各位大侠分析下,是否配置出了什么问题,在启动heartbeat后,所有realserver的权值全会变为0.

Forums:

没人回答吗?
我也碰到这个问题了!!!!

去/usr/sbin/ldirectord目录里面的ldirectord 修改权值即可。