That's a good idea. Take a look at the log snippet below. ipvsadm is
failing to add the entry for the FTP virtual servers. Whay might that
be?
<begin snip>
DEBUG2: Running exec(/usr/sbin/ldirectord -d start)
Running exec(/usr/sbin/ldirectord -d start)
DEBUG2: Invoking ldirectord invoked as: /usr/sbin/ldirectord start
Invoking ldirectord invoked as: /usr/sbin/ldirectord start
DEBUG2: Starting Linux Director v1.131 with pid: 3901
Starting Linux Director v1.131 with pid: 3901
DEBUG2: Running system(/sbin/ipvsadm -A -t 192.168.5.100:8080 -s rr )
Running system(/sbin/ipvsadm -A -t 192.168.5.100:8080 -s rr )
DEBUG2: Added virtual server: 192.168.5.100:8080
Added virtual server: 192.168.5.100:8080
DEBUG2: Running system(/sbin/ipvsadm -A -t 192.168.5.100:21 -s rr )
Running system(/sbin/ipvsadm -A -t 192.168.5.100:21 -s rr )
DEBUG2: Added virtual server: 192.168.5.100:21
Added virtual server: 192.168.5.100:21
DEBUG2: Running system(/sbin/ipvsadm -a -t 192.168.5.100:8080 -r
192.168.10.22:8080 -m -w 0)
Running system(/sbin/ipvsadm -a -t 192.168.5.100:8080 -r
192.168.10.22:8080 -m -w 0)
DEBUG2: Quiescent real server: 192.168.10.22:8080 ( x
192.168.5.100:8080) (Weight set to 0)
Quiescent real server: 192.168.10.22:8080 ( x 192.168.5.100:8080)
(Weight set to 0)
DEBUG2: Disabled server=192.168.10.22
DEBUG2: Running system(/sbin/ipvsadm -a -t 192.168.5.100:8080 -r
192.168.10.21:8080 -m -w 0)
Running system(/sbin/ipvsadm -a -t 192.168.5.100:8080 -r
192.168.10.21:8080 -m -w 0)
DEBUG2: Quiescent real server: 192.168.10.21:8080 ( x
192.168.5.100:8080) (Weight set to 0)
Quiescent real server: 192.168.10.21:8080 ( x 192.168.5.100:8080)
(Weight set to 0)
DEBUG2: Disabled server=192.168.10.21
DEBUG2: Running system(/sbin/ipvsadm -a -t 192.168.5.100:21 -r
192.168.10.22:21 -m -w 0)
Running system(/sbin/ipvsadm -a -t 192.168.5.100:21 -r 192.168.10.22:21
-m -w 0)
DEBUG2: Quiescent real server: 192.168.10.22:21 ( x 192.168.5.100:21)
(Weight set to 0)
Quiescent real server: 192.168.10.22:21 ( x 192.168.5.100:21) (Weight
set to 0)
DEBUG2: Disabled server=192.168.10.22
DEBUG2: Running system(/sbin/ipvsadm -a -t 192.168.5.100:21 -r
192.168.10.21:21 -m -w 0)
Running system(/sbin/ipvsadm -a -t 192.168.5.100:21 -r 192.168.10.21:21
-m -w 0)
DEBUG2: Quiescent real server: 192.168.10.21:21 ( x 192.168.5.100:21)
(Weight set to 0)
Quiescent real server: 192.168.10.21:21 ( x 192.168.5.100:21) (Weight
set to 0)
DEBUG2: Disabled server=192.168.10.21
DEBUG2: Checking negotiate: real
server=negotiate:http:tcp:192.168.10.21:8080::::\/index\.html:default\
Tomcat (virtual=tcp:192.168.5.100:8080)
DEBUG2: check_http: url="http://192.168.10.21:8080/index.html"
virtualhost="192.168.10.21"
LWP::UserAgent::new: ()
LWP::UserAgent::request: ()
LWP::UserAgent::send_request: GET http://192.168.10.21:8080/index.html
LWP::UserAgent::_need_proxy: Not proxied
LWP::Protocol::http::request: ()
LWP::Protocol::collect: read 779 bytes
LWP::Protocol::collect: read 1804 bytes
LWP::UserAgent::request: Simple response: OK
DEBUG2: Running system(/sbin/ipvsadm -e -t 192.168.5.100:8080 -r
192.168.10.21:8080 -m -w 1)
Running system(/sbin/ipvsadm -e -t 192.168.5.100:8080 -r
192.168.10.21:8080 -m -w 1)
DEBUG2: Restored real server: 192.168.10.21:8080 ( x 192.168.5.100:8080)
(Weight set to 1)
Restored real server: 192.168.10.21:8080 ( x 192.168.5.100:8080) (Weight
set to 1)
DEBUG2: Enabled server=192.168.10.21
DEBUG2: check_http: http://192.168.10.21:8080/index.html is up
DEBUG2: Checking negotiate: real
server=negotiate:http:tcp:192.168.10.22:8080::::\/index\.html:default\
Tomcat (virtual=tcp:192.168.5.100:8080)
DEBUG2: check_http: url="http://192.168.10.22:8080/index.html"
virtualhost="192.168.10.22"
LWP::UserAgent::new: ()
LWP::UserAgent::request: ()
LWP::UserAgent::send_request: GET http://192.168.10.22:8080/index.html
LWP::UserAgent::_need_proxy: Not proxied
LWP::Protocol::http::request: ()
LWP::Protocol::collect: read 2583 bytes
LWP::UserAgent::request: Simple response: OK
DEBUG2: Running system(/sbin/ipvsadm -e -t 192.168.5.100:8080 -r
192.168.10.22:8080 -m -w 1)
Running system(/sbin/ipvsadm -e -t 192.168.5.100:8080 -r
192.168.10.22:8080 -m -w 1)
DEBUG2: Restored real server: 192.168.10.22:8080 ( x 192.168.5.100:8080)
(Weight set to 1)
Restored real server: 192.168.10.22:8080 ( x 192.168.5.100:8080) (Weight
set to 1)
DEBUG2: Enabled server=192.168.10.22
DEBUG2: check_http: http://192.168.10.22:8080/index.html is up
DEBUG2: Checking negotiate: real
server=negotiate:ftp:tcp:192.168.10.21:21::::\/welcome\.msg:Test_Downloa
d_Success (virtual=tcp:192.168.5.100:21)
DEBUG2: Checking ftp server=192.168.10.21 port=21
DEBUG2: Running system(/sbin/ipvsadm -a -t 192.168.5.100:21 -r
192.168.10.21:21 -m -w 1)
Running system(/sbin/ipvsadm -a -t 192.168.5.100:21 -r 192.168.10.21:21
-m -w 1)
Destination already exists
DEBUG2: system(/sbin/ipvsadm -a -t 192.168.5.100:21 -r 192.168.10.21:21
-m -w 1) failed:
system(/sbin/ipvsadm -a -t 192.168.5.100:21 -r 192.168.10.21:21 -m -w 1)
failed:
DEBUG2: Added real server: 192.168.10.21:21 ( x 192.168.5.100:21)
(Weight set to 1)
Added real server: 192.168.10.21:21 ( x 192.168.5.100:21) (Weight set to
1)
DEBUG2: Enabled server=192.168.10.21
DEBUG2: Checking negotiate: real
server=negotiate:ftp:tcp:192.168.10.22:21::::\/welcome\.msg:Test_Downloa
d_Success (virtual=tcp:192.168.5.100:21)
DEBUG2: Checking ftp server=192.168.10.22 port=21
DEBUG2: Running system(/sbin/ipvsadm -a -t 192.168.5.100:21 -r
192.168.10.22:21 -m -w 1)
Running system(/sbin/ipvsadm -a -t 192.168.5.100:21 -r 192.168.10.22:21
-m -w 1)
Destination already exists
DEBUG2: system(/sbin/ipvsadm -a -t 192.168.5.100:21 -r 192.168.10.22:21
-m -w 1) failed:
system(/sbin/ipvsadm -a -t 192.168.5.100:21 -r 192.168.10.22:21 -m -w 1)
failed:
DEBUG2: Added real server: 192.168.10.22:21 ( x 192.168.5.100:21)
(Weight set to 1)
Added real server: 192.168.10.22:21 ( x 192.168.5.100:21) (Weight set to
1)
DEBUG2: Enabled server=192.168.10.22
DEBUG2: Checking negotiate: real
server=negotiate:http:tcp:192.168.10.21:8080::::\/index\.html:default\
Tomcat (virtual=tcp:192.168.5.100:8080)
DEBUG2: check_http: url="http://192.168.10.21:8080/index.html"
virtualhost="192.168.10.21"
LWP::UserAgent::new: ()
LWP::UserAgent::request: ()
LWP::UserAgent::send_request: GET http://192.168.10.21:8080/index.html
LWP::UserAgent::_need_proxy: Not proxied
LWP::Protocol::http::request: ()
LWP::Protocol::collect: read 2583 bytes
LWP::UserAgent::request: Simple response: OK
DEBUG2: Enabled server=192.168.10.21
DEBUG2: check_http: http://192.168.10.21:8080/index.html is up
DEBUG2: Checking negotiate: real
server=negotiate:http:tcp:192.168.10.22:8080::::\/index\.html:default\
Tomcat (virtual=tcp:192.168.5.100:8080)
DEBUG2: check_http: url="http://192.168.10.22:8080/index.html"
virtualhost="192.168.10.22"
LWP::UserAgent::new: ()
LWP::UserAgent::request: ()
LWP::UserAgent::send_request: GET http://192.168.10.22:8080/index.html
LWP::UserAgent::_need_proxy: Not proxied
LWP::Protocol::http::request: ()
LWP::Protocol::collect: read 2583 bytes
LWP::UserAgent::request: Simple response: OK
DEBUG2: Enabled server=192.168.10.22
DEBUG2: check_http: http://192.168.10.22:8080/index.html is up
DEBUG2: Checking negotiate: real
server=negotiate:ftp:tcp:192.168.10.21:21::::\/welcome\.msg:Test_Downloa
d_Success (virtual=tcp:192.168.5.100:21)
DEBUG2: Checking ftp server=192.168.10.21 port=21
DEBUG2: Enabled server=192.168.10.21
DEBUG2: Checking negotiate: real
server=negotiate:ftp:tcp:192.168.10.22:21::::\/welcome\.msg:Test_Downloa
d_Success (virtual=tcp:192.168.5.100:21)
DEBUG2: Checking ftp server=192.168.10.22 port=21
DEBUG2: Enabled server=192.168.10.22
DEBUG2: Checking negotiate: real
server=negotiate:http:tcp:192.168.10.21:8080::::\/index\.html:default\
Tomcat (virtual=tcp:192.168.5.100:8080)
DEBUG2: check_http: url="http://192.168.10.21:8080/index.html"
virtualhost="192.168.10.21"
<end snip>
--
Eric Robinson
-----Original Message-----
From: lvs-users-bounces@xxxxxxxxxxxxxxxxxxxxxx
[mailto:lvs-users-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Jason
Downing
Sent: Monday, July 03, 2006 4:05 PM
To: LinuxVirtualServer.org users mailing list.
Subject: Re: At Startup, I Get This: sed: -e expression #1, char
1:unknowncommand: `%'
Hi,
One thing I did when I had problems was to run ldirectord without
heartbeat.
This might temporarily remove your problems with heartbeat, so you can
have a closer look at the problem with logging into ftp. They appear to
be separate problems. I ran ldirectord with the command:
/usr/sbin/ldirectord -d start
This would run ldirectord in debug mode, and it would output all its
logging to the screen, so you could see when it issued the ipvsadm
commands to set up ipvs as a load balancer, and you could also see when
you removed or replaced a realserver. You could also stop ldirectord and
the load balancer would continue to work.
Remember heartbeat should be stopped first. You will also need to
manually bring up your VIP. This was the command I used:
ifconfig eth0:0 192.168.0.240 netmask 255.255.255.255 broadcast
192.168.0.255 up
Hope this helps, Jason
----- Original Message -----
From: "Robinson, Eric" eric.robinson@xxxxxxxxxx
To: <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Tuesday, July 04, 2006 2:24 AM
Subject: At Startup, I Get This: sed: -e expression #1, char 1:
unknowncommand: `%'
Hello list,
I am delighted to have gotten heartbeat and ldirectord running. I am now
able to load-balance traffic to two tomcat servers. However, I cannot
get FTP to work at all.
I fired up a sniffer and I can see ldirectord logging into the ftp
server and downloading the welcome.msg file, and I know the file
contains the right data, but for some reason ldirectord will not enable
the FTP virtual server. I've tried looking in ldirectord.log, but there
is no such file anywhere on my system (and I do not have a
syslog_facility enabled.)
I tried adding the --debug option to haresources, like this:
cluster1.nvipa.com \
LVSSyncDaemonSwap::master \
ldirectord::--debug::ldirectord.cf \
IPaddr2::192.168.5.100/24/eth0 \
IPaddr2::192.168.10.100/24/eth1
When I do that, I get additional logging DEBUG2 information in ha-debug.
The logging seems to show the FTP server being enabled. However, the
virtual IP address 192.168.5.100 does not get enabled. When I try to
stop heartbeat, it hangs forever and I have to do a hardware reset. When
it boots back up, heartbeat will not work until I take the --debug
parameter out of haresources and manually re-create /dev/watchdog. After
I do that, I can restart heartbeat and everything goes back to "normal,"
i.e., ldirectord virtualizes tomcat but not FTP.
I also get a couple of "unknown command" errors in ha-debug (see log
snippet below).
ResourceManager[3683]: 2006/07/02_14:25:20 info: Acquiring resource
group: cluster1.nvipa.com LVSSyncDaemonSwap::master
ldirectord::ldirectord.cf IPaddr2::192.168.5.100/24/eth0
IPaddr2::192.168.10.100/24/eth1
sed: -e expression #1, char 1: unknown command: `%'
sed: -e expression #1, char 1: unknown command: `%'
ResourceManager[3683]: 2006/07/02_14:25:21 info: Running
/etc/ha.d/resource.d/LVSSyncDaemonSwap master start
ResourceManager[3683]: 2006/07/02_14:25:21 debug: Starting
/etc/ha.d/resource.d/LVSSyncDaemonSwap master start
LVSSyncDaemonSwap[3745]: 2006/07/02_14:25:21 info:
ipvs_syncmaster up
LVSSyncDaemonSwap[3745]: 2006/07/02_14:25:21 info:
ipvs_syncmaster obtained
ResourceManager[3683]: 2006/07/02_14:25:21 debug:
/etc/ha.d/resource.d/LVSSyncDaemonSwap master start done. RC=0
Here's my config files:
ha.cf
-----
debugfile /var/log/ha-debug
logfile /var/log/ha-log
logfacility local0
traditional_compression false
keepalive 2
deadtime 30
warntime 10
initdead 120
udpport 694
baud 19200
serial /dev/ttyS0
bcast eth0
bcast eth1
#mcast eth0 225.0.0.1 694 1 0
#mcast eth1 225.0.0.1 694 1 0
auto_failback off
watchdog /dev/watchdog
node cluster1.nvipa.com
node cluster2.nvipa.com
respawn hacluster /usr/lib64/heartbeat/ipfail
debug 1
apiauth ipfail gid=haclient uid=hacluster
#apiauth ccm uid=hacluster
#apiauth ipfail gid=haclient uid=alanr,root
#apiauth default gid=haclient
haresources
-----------
cluster1.nvipa.com \
LVSSyncDaemonSwap::master \
ldirectord::ldirectord.cf \
IPaddr2::192.168.5.100/24/eth0 \
IPaddr2::192.168.10.100/24/eth1
ldirectord.cf
-------------
checktimeout=10
checkinterval=2
#fallback=127.0.0.1:80
autoreload=no
logfile="/var/log/ldirectord.log"
#logfile="local0"
quiescent=yes
# Virtual Server for HTTP
virtual=192.168.5.100:8080
#fallback=127.0.0.1:80
real=192.168.10.21:8080 masq
real=192.168.10.22:8080 masq
service=http
request="index.html"
receive="default Tomcat"
scheduler=rr
#persistent=600
protocol=tcp
checktype=negotiate
# Virtual Service for FTP
# Note that peresistancy needs to be turned on for FTP when
# used with LVS-TUN (ipip) or LVS-DR (gate), but not with LVS-NAT
(masq).
virtual=192.168.5.100:21
#fallback=127.0.0.1:21
real=192.168.10.21:21 masq
real=192.168.10.22:21 masq
service=ftp
request="welcome.msg"
receive="Test_Download_Success"
login="user"
passwd="me@"
scheduler=rr
#persistent=600
protocol=tcp
checktype=negotiate
welcome.msg
-----------
Test_Download_Success
Disclaimer - July 3, 2006
This email and any files transmitted with it are confidential and
intended
solely for lvs-users@xxxxxxxxxxxxxxxxxxxxxxx If you are not the named
addressee you should not disseminate, distribute, copy or alter this
email.
Any views or opinions presented in this email are solely those of the
author
and might not represent those of Physician Select Management (PSM) or
Physician's Managed Care (PMC). Warning: Although the message sender has
taken reasonable precautions to ensure no viruses are present in this
email,
neither PSM nor PMC can accept responsibility for any loss or damage
arising
from the use of this email or attachments.
|