Hi Horms, Julian, Wensong, list,
After all those years I've got a question as well :). I'm trying to get
LVS running in Debian testing (what a strange system) and I'm having
serious troubles with ipvsadm mismatches.
I've apt-get'd keepalived which installs ipvsadm as well (who knows why)
which however complains that it only works with 2.6.x kernels, which
again is utter crap.
So I did everything by myself since I can't apt-get an ipvsadm which
corresponds to a 2.4.x kernel IPVS. I've downloaded ipvsadm-1.21 which
goes with the 2.4.x kernel series and compiled it. However the binary
complains that the kernel version of IPVS is not correct. I'm using a
completely unpatched 2.4.27 kernel configured for sparc64.
I've sprinkled a few printf's into the code to help me debugging the
issue so don't panic if the output is not what you would expect from
ipvsadm-1.21:
sf-netra:~/ipvsadm-1.21# ./ipvsadm -L -n
ipvs_init successfull, returning socket fd=3
IP Virtual Server version 1.0.11 (size=16384)
Module is wrong version [ipvsadm.c:list_all:1580]
sf-netra:~/ipvsadm-1.21# strace -f -v -F -i ./ipvsadm
[????????] execve("./ipvsadm", ["./ipvsadm"], [/* 16 vars */]) = 0
[70012394] uname({sysname="Linux", nodename="sf-netra",
release="2.4.27", version="#1 Sat Oct 16 17:14:21 CEST 2004",
machine="sparc64"}) = 0
[7001101c] brk(0) = 0x26580
[70011b8c] access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file
or directory)
[70011a74] open("/etc/ld.so.preload", O_RDONLY) = -1 ENOENT (No such
file or directory)
[70011a74] open("/etc/ld.so.cache", O_RDONLY) = 3
[700119d8] fstat64(3, {st_dev=makedev(3, 1), st_ino=1343605,
st_mode=S_IFREG|0644, st_nlink=1, st_uid=0, st_gid=0, st_blksize=8192,
st_blocks=32, st_size=14454, st_atime=2004/10/17-19:26:41,
st_mtime=2004/10/17-12:16:55, st_ctime=2004/10/17-12:16:55}) = 0
[700122ec] mmap(NULL, 14454, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7001c000
[70011aac] close(3) = 0
[70011b8c] access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file
or directory)
[70011a74] open("/lib/libc.so.6", O_RDONLY) = 3
[70011ae4] read(3,
"\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\2\0\0\0\1\0\1\316"..., 512) = 512
[700119d8] fstat64(3, {st_dev=makedev(3, 1), st_ino=163965,
st_mode=S_IFREG|0644, st_nlink=1, st_uid=0, st_gid=0, st_blksize=8192,
st_blocks=2536, st_size=1291820, st_atime=2004/10/17-19:26:41,
st_mtime=2004/08/30-14:11:20, st_ctime=2004/09/13-07:32:05}) = 0
[700122ec] mmap(NULL, 1361736, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) =
0x7002c000
[7001235c] mprotect(0x70160000, 100168, PROT_NONE) = 0
[700122ec] mmap(0x7016c000, 49152, PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_PRIVATE|MAP_FIXED, 3, 0x130000) = 0x7016c000
[700122ec] mmap(0x70178000, 1864, PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x70178000
[70011aac] close(3) = 0
[70012324] munmap(0x7001c000, 14454) = 0
[701105b4] socket(PF_INET, SOCK_RAW, IPPROTO_RAW) = 3
[701100dc] getsockopt(3, SOL_IP, 0x481 /* IP_??? */,
"\0\1\0\v\0\0@\0\0\0\0\1", [12]) = 0
[70100bb8] fstat64(1, {st_dev=makedev(3, 1), st_ino=1818869,
st_mode=S_IFCHR|0620, st_nlink=1, st_uid=1001, st_gid=5,
st_blksize=8192, st_blocks=0, st_rdev=makedev(3, 3),
st_atime=2004/10/17-19:26:41, st_mtime=2004/10/17-19:26:41,
st_ctime=2004/10/17-18:37:05}) = 0
[701074b4] ioctl(1, TCSETAF or SNDCTL_TMR_SELECT, {c_iflags=0x100,
c_oflags=0x5, c_cflags=0xbf, c_lflags=0x8a3b, c_line=0,
c_cc="\x03\x1c\x7f\x15\x04\x00\x00\x00\x11\x13\x1a\x19\x12\x0f\x17\x16\x01"})
= 0
[7010c040] mmap(NULL, 8192, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7001a000
[7010160c] write(1, "ipvs_init successfull, returning"..., 45ipvs_init
successfull, returning socket fd=3
) = 45
[7010160c] write(1, "IP Virtual Server version 1.0.11"..., 46IP Virtual
Server version 1.0.11 (size=16384)
) = 46
[70107cf8] brk(0) = 0x26580
[70107cf8] brk(0x48580) = 0x48580
[70107cf8] brk(0) = 0x48580
[70107cf8] brk(0x4a000) = 0x4a000
[701100dc] getsockopt(3, SOL_IP, 0x482 /* IP_??? */, 0x265d0,
0xeffffc14) = -1 EINVAL (Invalid argument)
[70107cf8] brk(0) = 0x4a000
[70107cf8] brk(0) = 0x4a000
[70107cf8] brk(0x48000) = 0x48000
[70107cf8] brk(0) = 0x48000
[7010160c] write(2, "Module is wrong version [ipvsadm"..., 50Module is
wrong version [ipvsadm.c:list_all:1580]
) = 50
[7010c19c] munmap(0x7001a000, 8192) = 0
[700de39c] sysconf(0x1 <unfinished ... exit status 1>
sf-netra:~/ipvsadm-1.21#
The ip_vs kernel module barfs with lines like:
IPVS: Connection hash table configured (size=16384, memory=256Kbytes)
IPVS: Each connection entry needs 184 bytes at least
IPVS: ipvs loaded.
IPVS: set_ctl: len 0 < 92
IPVS: set_ctl: len 44 < 92
IPVS: set_ctl: len 68 < 92
IPVS: length: 4 < 8
IPVS: [wlc] scheduler registered.
IPVS: length: 92 != 112
which clearly indicates that we're submitting the wrongly sized get
buffer via ioctl. What did I miss here? I'm compiling with the correct
headers as far as I can see.
Thanks for any pointers. This is the first system in years that doesn't
want to work out of the box. But Debian is known to be a little bit
difficult if the human sitting behind is of limited intelligence.
Regards,
Roberto Nibali, ratz
--
echo
'[q]sa[ln0=aln256%Pln256/snlbx]sb3135071790101768542287578439snlbxq' | dc
|