Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux Virtual Server: Users

[lvs-users] LdirectorD LVS and CentOS/Fedora/RedHat

 

 

Linux Virtual Server users RSS feed   Index | Next | Previous | View Threaded


partysoft at gmail

Oct 21, 2009, 10:20 PM

Post #1 of 11 (1600 views)
Permalink
[lvs-users] LdirectorD LVS and CentOS/Fedora/RedHat

Hello, i've been trying to setup on Centos 5 LdirectorD without Heartbeat,
and everything seems to work but no redirection, the RealServers arren't
reached....

The thing i don't understand is this: will All the servers have to be in LAN
using a 192.XXX ips?
I actually have all the servers with a public IP, and no way to put them in
LAN , i understood that i should use ipip (TUN) method, but i there isn't a
good doc out there how to setup the tun0 on the servers, and stuff like that

What if i put them in VPN will that simulate a LAN an let the gate method
work? i plan to use OpenVpn (that actually is through Tun)

Or is it because i haven't used Heartbeat service to spawn ldirectord? i'm
completly lost..
--
View this message in context: http://www.nabble.com/LdirectorD-LVS-and-CentOS-Fedora-RedHat-tp26004219p26004219.html
Sent from the LVS mailing list archive at Nabble.com.


_______________________________________________
Please read the documentation before posting - it's available at:
http://www.linuxvirtualserver.org/

LinuxVirtualServer.org mailing list - lvs-users [at] LinuxVirtualServer
Send requests to lvs-users-request [at] LinuxVirtualServer
or go to http://lists.graemef.net/mailman/listinfo/lvs-users


leon at linux

Oct 22, 2009, 1:19 AM

Post #2 of 11 (1550 views)
Permalink
Re: [lvs-users] LdirectorD LVS and CentOS/Fedora/RedHat [In reply to]

On Wed, 2009-10-21 at 22:20 -0700, partysoft wrote:
> Hello, i've been trying to setup on Centos 5 LdirectorD without Heartbeat,
> and everything seems to work but no redirection, the RealServers arren't
> reached....

>From where? The director? The client? How did you come to this
conclusion; packet sniffing, realserver logfiles, something else?

> The thing i don't understand is this: will All the servers have to be in LAN
> using a 192.XXX ips?

Depends on what you're trying to do.

> I actually have all the servers with a public IP, and no way to put them in
> LAN , i understood that i should use ipip (TUN) method, but i there isn't a
> good doc out there how to setup the tun0 on the servers, and stuff like that
>
> What if i put them in VPN will that simulate a LAN an let the gate method
> work? i plan to use OpenVpn (that actually is through Tun)
>
> Or is it because i haven't used Heartbeat service to spawn ldirectord? i'm
> completly lost..

Yes, it seems so :) Why don't you start by reading the HOWTO? If you
have realservers with a public IP and your director with a public IP in
the same subnet, you could try setting up LVS-DR. It requires for you to
add a loopback device on the realservers and, depending on the OS, solve
the arp problem.

http://www.austintek.com/LVS/LVS-HOWTO/HOWTO/

LVS-TUN is probably not what you want. Heartbeat and ldirectord are used
mainly for when you're setting up a failover cluster with 2 or more
directors. The best way to learn LVS is to set up the IPVS table
manually so later you know what ldirector automagically does for you :)

--
Léon


_______________________________________________
Please read the documentation before posting - it's available at:
http://www.linuxvirtualserver.org/

LinuxVirtualServer.org mailing list - lvs-users [at] LinuxVirtualServer
Send requests to lvs-users-request [at] LinuxVirtualServer
or go to http://lists.graemef.net/mailman/listinfo/lvs-users


partysoft at gmail

Oct 22, 2009, 8:57 AM

Post #3 of 11 (1529 views)
Permalink
Re: [lvs-users] LdirectorD LVS and CentOS/Fedora/RedHat [In reply to]

Thank you Léon for the reply. I apreciate it so much.
Yes i actually have 3 public ip's like (none are with 192..)
XX.XX.XX.234 (this is the lvs..)
XX.XX.XX.235 real server (web ngix)
YYY.YYY.YYY.163 real server (web apache) - I don't really care about this
one, i can move it into the

we will use XX.XX.XX.236 as virtual..(there isn't an ip on the net with that
number up). of course it will be simpler to use a 192.. but, i have tried
that also ,and no luck

same subnet as the first 2 ones, i just want to make it work from the 234 ->
235..but it gives me a timeout on the browser...
Here's what i did:

[root [at] linu ~]# cat /etc/ha.d/ldirectord.cf
checktimeout=3
checkinterval=10
autoreload=yes
logfile="/var/log/ldirectord.log"
quiescent=no
virtual=XX.XX.XX.236:80
fallback=127.0.0.1:80
real=XX.XX.XX.235:80 gate
real=YYY.YYY.YYY.235:80 gate
service=http
request="test.html"
receive="Still alive"
scheduler=rr #here i've tried with wlr as well
protocol=tcp
checktype=negotiate

[root [at] linu ~]# /usr/sbin/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.186-ha-2.1.4 with pid: 18619
Starting Linux Director v1.186-ha-2.1.4 with pid: 18619
DEBUG2: Running system(/sbin/ipvsadm -A -t XX.XX.XX.236:80 -s rr )
Running system(/sbin/ipvsadm -A -t XX.XX.XX.236:80 -s rr )
DEBUG2: Added virtual server: XX.XX.XX.236:80
Added virtual server: XX.XX.XX.236:80
DEBUG2: Running system(/sbin/ipvsadm -a -t XX.XX.XX.236:80 -r 127.0.0.1:80
-g -w 1)
Running system(/sbin/ipvsadm -a -t XX.XX.XX.236:80 -r 127.0.0.1:80 -g -w 1)
DEBUG2: Added fallback server: 127.0.0.1:80 (XX.XX.XX.236:80) (Weight set to
1)
Added fallback server: 127.0.0.1:80 (XX.XX.XX.236:80) (Weight set to 1)
DEBUG2: Disabled real
server=negotiate:http:tcp:XX.XX.XX.235:80:::1:gate:\/test\.html:Still\ alive
(virtual=tcp:XX.XX.XX.236:80)
DEBUG2: Checking negotiate: real
server=negotiate:http:tcp:XX.XX.XX.235:80:::1:gate:\/test\.html:Still\ alive
(virtual=tcp:XX.XX.XX.236:80)
DEBUG2: check_http: url="http://XX.XX.XX.235:80/test.html"
virtualhost="XX.XX.XX.235"
LWP::UserAgent::new: ()
DEBUG2: Starting Check
DEBUG2: Starting HTTP/HTTPS
LWP::UserAgent::request: ()
LWP::UserAgent::send_request: GET http://XX.XX.XX.235:80/test.html
LWP::UserAgent::_need_proxy: Not proxied
LWP::Protocol::http::request: ()
LWP::Protocol::collect: read 12 bytes
LWP::UserAgent::request: Simple response: OK
DEBUG2: Finished HTTP/HTTPS
DEBUG2: Running system(/sbin/ipvsadm -a -t XX.XX.XX.236:80 -r
XX.XX.XX.235:80 -g -w 1)
Running system(/sbin/ipvsadm -a -t XX.XX.XX.236:80 -r XX.XX.XX.235:80 -g -w
1)
DEBUG2: system(/sbin/ipvsadm -a -t XX.XX.XX.236:80 -r XX.XX.XX.235:80 -g -w
1) failed: No child processes
system(/sbin/ipvsadm -a -t XX.XX.XX.236:80 -r XX.XX.XX.235:80 -g -w 1)
failed: No child processes
DEBUG2: Added real server: XX.XX.XX.235:80 (XX.XX.XX.236:80) (Weight set to
1)
Added real server: XX.XX.XX.235:80 (XX.XX.XX.236:80) (Weight set to 1)
DEBUG2: Running system(/sbin/ipvsadm -d -t XX.XX.XX.236:80 -r 127.0.0.1:80)
Running system(/sbin/ipvsadm -d -t XX.XX.XX.236:80 -r 127.0.0.1:80)
DEBUG2: system(/sbin/ipvsadm -d -t XX.XX.XX.236:80 -r 127.0.0.1:80) failed:
No child processes
system(/sbin/ipvsadm -d -t XX.XX.XX.236:80 -r 127.0.0.1:80) failed: No child
processes
DEBUG2: Deleted fallback server: 127.0.0.1:80 (XX.XX.XX.236:80)
Deleted fallback server: 127.0.0.1:80 (XX.XX.XX.236:80)
DEBUG2: Enabled real
server=negotiate:http:tcp:XX.XX.XX.235:80:::1:gate:\/test\.html:Still\ alive
(virtual=tcp:XX.XX.XX.236:80)
DEBUG2: check_http: http://XX.XX.XX.235:80/test.html is up

If i go to the webserver i can see that ldirector is actually testing the
test.html..every 10 seconds like in the conf

-----------------------------------------------

I am sure that is because of the configurations of the IPs and the aditional
eth0:0 and lo:0 and that's why it doesn't work, i will paste everything that
i did, maybe, just maybe you can help me out on this one, i'm really
stuck..probably because i don't know lots of stuff on how the OSI layer is
build and how arp works

Aditional Network conf..
XX.XX.XX.234 (this is the lvs..) is spawned on eth1..
so i spawned another eth1:0
[root [at] linu ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1:0
DEVICE=eth1:0
IPADDR=XX.XX.XX.236 # this is from the same subnet and i doesn't conflict
with an existent one
NETMASK=255.255.255.0
NETWORK=XX.XX.XX.0
BROADCAST=XX.XX.XX.255
GATEWAY=XX.XX.XX.233 # i've put the same gateway as the default ip
XX.XX.XX.234 had
ONBOOT=yes

i also enabled port forwarding

net.ipv4.ip_forward = 1
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296

And i did the modprobe with all those modules for IPV

modprobe ip_vs_dh
modprobe ip_vs_ftp
modprobe ip_vs_dh
modprobe ip_vs_ftp
modprobe ip_vs
modprobe ip_vs_lblc
modprobe ip_vs_lblcr
modprobe ip_vs_lc
modprobe ip_vs_nq
modprobe ip_vs_rr
modprobe ip_vs_sed
modprobe ip_vs_sh
modprobe ip_vs_wlc
modprobe ip_vs_wrr

and that's all i did for the LVS server..

Now for the webserver
XX.XX.XX.235 (this is the lvs..) is spawned on eth0..
root [at] linu ~]# cat /etc/sysconfig/network-scripts/ifcfg-lo:0
DEVICE=lo:0
IPADDR=XX.XX.XX.236
NETMASK=255.255.255.255
NETWORK=XX.XX.XX.XX.0
BROADCAST=XX.XX.XX.255
ONBOOT=yes
NAME=loopback

and

net.ipv4.ip_forward = 0
net.ipv4.conf.lo.arp_ignore = 1 #here i have tried with eth0 instead of
lo, no luck..
net.ipv4.conf.lo.arp_announce = 2 #here i have tried with eth0 instead of
lo, no luck..
net.ipv4.conf.all.arp_ignore = 1
net.ipv4.conf.all.arp_announce = 2
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296

here i've tried with ip forward 0 and 1 , no luck the requests simply don't
reach this server only the direct ones

Now i've understand that this is an ARP problem, and as CentOS doesn't
support the arp hidden flag on sysctl , i tried with
/etc/init.d/arptables_jf

arptables -A IN -j DROP -d XX.XX.XX.236
-A OUT -j mangle -o eth0 -s XX.XX.XX.234 --mangle-ip-s XX.XX.XX.236
arptables -A OUT -j mangle -o eth0 -s XX.XX.XX.234 --mangle-ip-s
XX.XX.XX.236
/etc/init.d/arptables_jf save
/etc/init.d/arptables_jf start
/sbin/arptables -L -v -n

hain IN (policy ACCEPT 1353 packets, 37884 bytes)
pkts bytes target in out source-ip destination-ip
source-hw destination-hw hlen op hrd pro
0 0 DROP * * 0.0.0.0/0 XX.XX.XX.236
00/00 00/00 any 0000/0000 0000/0000 0000/0000

Chain OUT (policy ACCEPT 25 packets, 700 bytes)
pkts bytes target in out source-ip destination-ip
source-hw destination-hw hlen op hrd pro
0 0 mangle * eth0 XX.XX.XX.234 0.0.0.0/0
00/00 00/00 any 0000/0000 0000/0000 0000/0000
--mangle-ip-s XX.XX.XX.236

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target in out source-ip destination-ip
source-hw destination-hw hlen op hrd pro

-----------------------------------------------

i've probed with ipvsadm or something like it, to see the active
connections, and they are always to 0

i've modprobed here the same modules, no luck..

So from this point i'm really stuck and don't know what to do...

Here's the ifconfig from both servers if that helps
from the LVS (xx.234)

eth1 Link encap:Ethernet HWaddr 00:1B:21:46:3E:A9
inet addr:XX.XX.XX.234 Bcast:XX.XX.XX.239 Mask:255.255.255.248
inet6 addr: fe80::21b:21ff:fe45:3ea9/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:276338 errors:0 dropped:2 overruns:0 frame:0
TX packets:220590 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:156995116 (149.7 MiB) TX bytes:30754525 (29.3 MiB)
Base address:0xd000 Memory:e2020000-e2040000

eth1:0 Link encap:Ethernet HWaddr 00:1B:21:46:3E:A9
inet addr:XX.XX.XX.236 Bcast:XX.XX.XX.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Base address:0xd000 Memory:e2020000-e2040000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:150 errors:0 dropped:0 overruns:0 frame:0
TX packets:150 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:16592 (16.2 KiB) TX bytes:16592 (16.2 KiB)

here's the one from the webserver

eth0 Link encap:Ethernet HWaddr 00:24:1D:72:61:AB
inet addr:XX.XX.XX.235 Bcast:XX.XX.XX.239 Mask:255.255.255.248
inet6 addr: fe80::224:1dff:fe74:61ab/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:301529 errors:0 dropped:0 overruns:0 frame:0
TX packets:255827 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:149822776 (142.8 MiB) TX bytes:36393789 (34.7 MiB)
Interrupt:233 Base address:0x2000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:56 errors:0 dropped:0 overruns:0 frame:0
TX packets:56 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4448 (4.3 KiB) TX bytes:4448 (4.3 KiB)

lo:0 Link encap:Local Loopback
inet addr:XX.XX.XX.236 Mask:255.255.255.255
UP LOOPBACK RUNNING MTU:16436 Metric:1

I thank you in advance for helping solve this problem. I think it's a
problem that many have with Fedora/Red Hat/ Cent-oS




L.S. Keijser-2 wrote:
>
> On Wed, 2009-10-21 at 22:20 -0700, partysoft wrote:
>> Hello, i've been trying to setup on Centos 5 LdirectorD without
>> Heartbeat,
>> and everything seems to work but no redirection, the RealServers arren't
>> reached....
>
>>From where? The director? The client? How did you come to this
> conclusion; packet sniffing, realserver logfiles, something else?
>
>> The thing i don't understand is this: will All the servers have to be in
>> LAN
>> using a 192.XX ips?
>
> Depends on what you're trying to do.
>
>> I actually have all the servers with a public IP, and no way to put them
>> in
>> LAN , i understood that i should use ipip (TUN) method, but i there isn't
>> a
>> good doc out there how to setup the tun0 on the servers, and stuff like
>> that
>>
>> What if i put them in VPN will that simulate a LAN an let the gate method
>> work? i plan to use OpenVpn (that actually is through Tun)
>>
>> Or is it because i haven't used Heartbeat service to spawn ldirectord?
>> i'm
>> completly lost..
>
> Yes, it seems so :) Why don't you start by reading the HOWTO? If you
> have realservers with a public IP and your director with a public IP in
> the same subnet, you could try setting up LVS-DR. It requires for you to
> add a loopback device on the realservers and, depending on the OS, solve
> the arp problem.
>
> http://www.austintek.com/LVS/LVS-HOWTO/HOWTO/
>
> LVS-TUN is probably not what you want. Heartbeat and ldirectord are used
> mainly for when you're setting up a failover cluster with 2 or more
> directors. The best way to learn LVS is to set up the IPVS table
> manually so later you know what ldirector automagically does for you :)
>
> --
> Léon
>
>
> _______________________________________________
> Please read the documentation before posting - it's available at:
> http://www.linuxvirtualserver.org/
>
> LinuxVirtualServer.org mailing list - lvs-users [at] LinuxVirtualServer
> Send requests to lvs-users-request [at] LinuxVirtualServer
> or go to http://lists.graemef.net/mailman/listinfo/lvs-users
>

--
View this message in context: http://www.nabble.com/LdirectorD-LVS-and-CentOS-Fedora-RedHat-tp26004219p26012610.html
Sent from the LVS mailing list archive at Nabble.com.


_______________________________________________
Please read the documentation before posting - it's available at:
http://www.linuxvirtualserver.org/

LinuxVirtualServer.org mailing list - lvs-users [at] LinuxVirtualServer
Send requests to lvs-users-request [at] LinuxVirtualServer
or go to http://lists.graemef.net/mailman/listinfo/lvs-users


partysoft at gmail

Oct 22, 2009, 9:49 AM

Post #4 of 11 (1521 views)
Permalink
Re: [lvs-users] LdirectorD LVS and CentOS/Fedora/RedHat [In reply to]

Thank you Léon for the reply. I apreciate it so much.
Yes i actually have 3 public ip's like (none are with 192..)
XX.XX.XX.234 (this is the lvs..)
XX.XX.XX.235 real server (web ngix)
YYY.YYY.YYY.163 real server (web apache) - I don't really care about this
one, i can move it into the

we will use XX.XX.XX.236 as virtual..(there isn't an ip on the net with that
number up). of course it will be simpler to use a 192.. but, i have tried
that also ,and no luck

same subnet as the first 2 ones, i just want to make it work from the 234 ->
235..but it gives me a timeout on the browser...
Here's what i did:

[root [at] linu ~]# cat /etc/ha.d/ldirectord.cf
checktimeout=3
checkinterval=10
autoreload=yes
logfile="/var/log/ldirectord.log"
quiescent=no
virtual=XX.XX.XX.236:80
fallback=127.0.0.1:80
real=XX.XX.XX.235:80 gate
real=YYY.YYY.YYY.235:80 gate
service=http
request="test.html"
receive="Still alive"
scheduler=rr #here i've tried with wlr as well
protocol=tcp
checktype=negotiate

[root [at] linu ~]# /usr/sbin/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.186-ha-2.1.4 with pid: 18619
Starting Linux Director v1.186-ha-2.1.4 with pid: 18619
DEBUG2: Running system(/sbin/ipvsadm -A -t XX.XX.XX.236:80 -s rr )
Running system(/sbin/ipvsadm -A -t XX.XX.XX.236:80 -s rr )
DEBUG2: Added virtual server: XX.XX.XX.236:80
Added virtual server: XX.XX.XX.236:80
DEBUG2: Running system(/sbin/ipvsadm -a -t XX.XX.XX.236:80 -r 127.0.0.1:80
-g -w 1)
Running system(/sbin/ipvsadm -a -t XX.XX.XX.236:80 -r 127.0.0.1:80 -g -w 1)
DEBUG2: Added fallback server: 127.0.0.1:80 (XX.XX.XX.236:80) (Weight set to
1)
Added fallback server: 127.0.0.1:80 (XX.XX.XX.236:80) (Weight set to 1)
DEBUG2: Disabled real
server=negotiate:http:tcp:XX.XX.XX.235:80:::1:gate:\/test\.html:Still\ alive
(virtual=tcp:XX.XX.XX.236:80)
DEBUG2: Checking negotiate: real
server=negotiate:http:tcp:XX.XX.XX.235:80:::1:gate:\/test\.html:Still\ alive
(virtual=tcp:XX.XX.XX.236:80)
DEBUG2: check_http: url="http://XX.XX.XX.235:80/test.html"
virtualhost="XX.XX.XX.235"
LWP::UserAgent::new: ()
DEBUG2: Starting Check
DEBUG2: Starting HTTP/HTTPS
LWP::UserAgent::request: ()
LWP::UserAgent::send_request: GET http://XX.XX.XX.235:80/test.html
LWP::UserAgent::_need_proxy: Not proxied
LWP::Protocol::http::request: ()
LWP::Protocol::collect: read 12 bytes
LWP::UserAgent::request: Simple response: OK
DEBUG2: Finished HTTP/HTTPS
DEBUG2: Running system(/sbin/ipvsadm -a -t XX.XX.XX.236:80 -r
XX.XX.XX.235:80 -g -w 1)
Running system(/sbin/ipvsadm -a -t XX.XX.XX.236:80 -r XX.XX.XX.235:80 -g -w
1)
DEBUG2: system(/sbin/ipvsadm -a -t XX.XX.XX.236:80 -r XX.XX.XX.235:80 -g -w
1) failed: No child processes
system(/sbin/ipvsadm -a -t XX.XX.XX.236:80 -r XX.XX.XX.235:80 -g -w 1)
failed: No child processes
DEBUG2: Added real server: XX.XX.XX.235:80 (XX.XX.XX.236:80) (Weight set to
1)
Added real server: XX.XX.XX.235:80 (XX.XX.XX.236:80) (Weight set to 1)
DEBUG2: Running system(/sbin/ipvsadm -d -t XX.XX.XX.236:80 -r 127.0.0.1:80)
Running system(/sbin/ipvsadm -d -t XX.XX.XX.236:80 -r 127.0.0.1:80)
DEBUG2: system(/sbin/ipvsadm -d -t XX.XX.XX.236:80 -r 127.0.0.1:80) failed:
No child processes
system(/sbin/ipvsadm -d -t XX.XX.XX.236:80 -r 127.0.0.1:80) failed: No child
processes
DEBUG2: Deleted fallback server: 127.0.0.1:80 (XX.XX.XX.236:80)
Deleted fallback server: 127.0.0.1:80 (XX.XX.XX.236:80)
DEBUG2: Enabled real
server=negotiate:http:tcp:XX.XX.XX.235:80:::1:gate:\/test\.html:Still\ alive
(virtual=tcp:XX.XX.XX.236:80)
DEBUG2: check_http: http://XX.XX.XX.235:80/test.html is up

If i go to the webserver i can see that ldirector is actually testing the
test.html..every 10 seconds like in the conf

-----------------------------------------------

I am sure that is because of the configurations of the IPs and the aditional
eth0:0 and lo:0 and that's why it doesn't work, i will paste everything that
i did, maybe, just maybe you can help me out on this one, i'm really
stuck..probably because i don't know lots of stuff on how the OSI layer is
build and how arp works

Aditional Network conf..
XX.XX.XX.234 (this is the lvs..) is spawned on eth1..
so i spawned another eth1:0
[root [at] linu ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1:0
DEVICE=eth1:0
IPADDR=XX.XX.XX.236 # this is from the same subnet and i doesn't conflict
with an existent one
NETMASK=255.255.255.0
NETWORK=XX.XX.XX.0
BROADCAST=XX.XX.XX.255
GATEWAY=XX.XX.XX.233 # i've put the same gateway as the default ip
XX.XX.XX.234 had
ONBOOT=yes

i also enabled port forwarding

net.ipv4.ip_forward = 1
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296

And i did the modprobe with all those modules for IPV

modprobe ip_vs_dh
modprobe ip_vs_ftp
modprobe ip_vs_dh
modprobe ip_vs_ftp
modprobe ip_vs
modprobe ip_vs_lblc
modprobe ip_vs_lblcr
modprobe ip_vs_lc
modprobe ip_vs_nq
modprobe ip_vs_rr
modprobe ip_vs_sed
modprobe ip_vs_sh
modprobe ip_vs_wlc
modprobe ip_vs_wrr

and that's all i did for the LVS server..

Now for the webserver
XX.XX.XX.235 (this is the lvs..) is spawned on eth0..
root [at] linu ~]# cat /etc/sysconfig/network-scripts/ifcfg-lo:0
DEVICE=lo:0
IPADDR=XX.XX.XX.236
NETMASK=255.255.255.255
NETWORK=XX.XX.XX.XX.0
BROADCAST=XX.XX.XX.255
ONBOOT=yes
NAME=loopback

and

net.ipv4.ip_forward = 0
net.ipv4.conf.lo.arp_ignore = 1 #here i have tried with eth0 instead of
lo, no luck..
net.ipv4.conf.lo.arp_announce = 2 #here i have tried with eth0 instead of
lo, no luck..
net.ipv4.conf.all.arp_ignore = 1
net.ipv4.conf.all.arp_announce = 2
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296

here i've tried with ip forward 0 and 1 , no luck the requests simply don't
reach this server only the direct ones

Now i've understand that this is an ARP problem, and as CentOS doesn't
support the arp hidden flag on sysctl , i tried with
/etc/init.d/arptables_jf

arptables -A IN -j DROP -d XX.XX.XX.236
-A OUT -j mangle -o eth0 -s XX.XX.XX.234 --mangle-ip-s XX.XX.XX.236
arptables -A OUT -j mangle -o eth0 -s XX.XX.XX.234 --mangle-ip-s
XX.XX.XX.236
/etc/init.d/arptables_jf save
/etc/init.d/arptables_jf start
/sbin/arptables -L -v -n

hain IN (policy ACCEPT 1353 packets, 37884 bytes)
pkts bytes target in out source-ip destination-ip
source-hw destination-hw hlen op hrd pro
0 0 DROP * * 0.0.0.0/0 XX.XX.XX.236
00/00 00/00 any 0000/0000 0000/0000 0000/0000

Chain OUT (policy ACCEPT 25 packets, 700 bytes)
pkts bytes target in out source-ip destination-ip
source-hw destination-hw hlen op hrd pro
0 0 mangle * eth0 XX.XX.XX.234 0.0.0.0/0
00/00 00/00 any 0000/0000 0000/0000 0000/0000
--mangle-ip-s XX.XX.XX.236

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target in out source-ip destination-ip
source-hw destination-hw hlen op hrd pro

-----------------------------------------------

i've probed with ipvsadm or something like it, to see the active
connections, and they are always to 0

i've modprobed here the same modules, no luck..

So from this point i'm really stuck and don't know what to do...

Here's the ifconfig from both servers if that helps
from the LVS (xx.234)

eth1 Link encap:Ethernet HWaddr 00:1B:21:46:3E:A9
inet addr:XX.XX.XX.234 Bcast:XX.XX.XX.239 Mask:255.255.255.248
inet6 addr: fe80::21b:21ff:fe45:3ea9/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:276338 errors:0 dropped:2 overruns:0 frame:0
TX packets:220590 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:156995116 (149.7 MiB) TX bytes:30754525 (29.3 MiB)
Base address:0xd000 Memory:e2020000-e2040000

eth1:0 Link encap:Ethernet HWaddr 00:1B:21:46:3E:A9
inet addr:XX.XX.XX.236 Bcast:XX.XX.XX.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Base address:0xd000 Memory:e2020000-e2040000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:150 errors:0 dropped:0 overruns:0 frame:0
TX packets:150 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:16592 (16.2 KiB) TX bytes:16592 (16.2 KiB)

here's the one from the webserver

eth0 Link encap:Ethernet HWaddr 00:24:1D:72:61:AB
inet addr:XX.XX.XX.235 Bcast:XX.XX.XX.239 Mask:255.255.255.248
inet6 addr: fe80::224:1dff:fe74:61ab/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:301529 errors:0 dropped:0 overruns:0 frame:0
TX packets:255827 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:149822776 (142.8 MiB) TX bytes:36393789 (34.7 MiB)
Interrupt:233 Base address:0x2000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:56 errors:0 dropped:0 overruns:0 frame:0
TX packets:56 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4448 (4.3 KiB) TX bytes:4448 (4.3 KiB)

lo:0 Link encap:Local Loopback
inet addr:XX.XX.XX.236 Mask:255.255.255.255
UP LOOPBACK RUNNING MTU:16436 Metric:1

I thank you in advance for helping solve this problem. I think it's a
problem that many have with Fedora/Red Hat/ Cent-oS




L.S. Keijser-2 wrote:
>
> On Wed, 2009-10-21 at 22:20 -0700, partysoft wrote:
>> Hello, i've been trying to setup on Centos 5 LdirectorD without
>> Heartbeat,
>> and everything seems to work but no redirection, the RealServers arren't
>> reached....
>
>>From where? The director? The client? How did you come to this
> conclusion; packet sniffing, realserver logfiles, something else?
>
>> The thing i don't understand is this: will All the servers have to be in
>> LAN
>> using a 192.XX ips?
>
> Depends on what you're trying to do.
>
>> I actually have all the servers with a public IP, and no way to put them
>> in
>> LAN , i understood that i should use ipip (TUN) method, but i there isn't
>> a
>> good doc out there how to setup the tun0 on the servers, and stuff like
>> that
>>
>> What if i put them in VPN will that simulate a LAN an let the gate method
>> work? i plan to use OpenVpn (that actually is through Tun)
>>
>> Or is it because i haven't used Heartbeat service to spawn ldirectord?
>> i'm
>> completly lost..
>
> Yes, it seems so :) Why don't you start by reading the HOWTO? If you
> have realservers with a public IP and your director with a public IP in
> the same subnet, you could try setting up LVS-DR. It requires for you to
> add a loopback device on the realservers and, depending on the OS, solve
> the arp problem.
>
> http://www.austintek.com/LVS/LVS-HOWTO/HOWTO/
>
> LVS-TUN is probably not what you want. Heartbeat and ldirectord are used
> mainly for when you're setting up a failover cluster with 2 or more
> directors. The best way to learn LVS is to set up the IPVS table
> manually so later you know what ldirector automagically does for you :)
>
> --
> Léon
>
>
> _______________________________________________
> Please read the documentation before posting - it's available at:
> http://www.linuxvirtualserver.org/
>
> LinuxVirtualServer.org mailing list - lvs-users [at] LinuxVirtualServer
> Send requests to lvs-users-request [at] LinuxVirtualServer
> or go to http://lists.graemef.net/mailman/listinfo/lvs-users
>

--
View this message in context: http://www.nabble.com/LdirectorD-LVS-and-CentOS-Fedora-RedHat-tp26004219p26012610.html
Sent from the LVS mailing list archive at Nabble.com.


_______________________________________________
Please read the documentation before posting - it's available at:
http://www.linuxvirtualserver.org/

LinuxVirtualServer.org mailing list - lvs-users [at] LinuxVirtualServer
Send requests to lvs-users-request [at] LinuxVirtualServer
or go to http://lists.graemef.net/mailman/listinfo/lvs-users


partysoft at gmail

Oct 22, 2009, 12:39 PM

Post #5 of 11 (1537 views)
Permalink
Re: [lvs-users] LdirectorD LVS and CentOS/Fedora/RedHat [In reply to]

Thank you Léon for the reply. I apreciate it so much.
Yes i actually have 3 public ip's like (none are with 192..)
XX.XX.XX.234 (this is the lvs..)
XX.XX.XX.235 real server (web ngix)
YYY.YYY.YYY.163 real server (web apache) - I don't really care about this
one, i can move it into the

we will use XX.XX.XX.236 as virtual..(there isn't an ip on the net with that
number up). of course it will be simpler to use a 192.. but, i have tried
that also ,and no luck

same subnet as the first 2 ones, i just want to make it work from the 234 ->
235..but it gives me a timeout on the browser...
Here's what i did:

[root [at] linu ~]# cat /etc/ha.d/ldirectord.cf
checktimeout=3
checkinterval=10
autoreload=yes
logfile="/var/log/ldirectord.log"
quiescent=no
virtual=XX.XX.XX.236:80
fallback=127.0.0.1:80
real=XX.XX.XX.235:80 gate
real=YYY.YYY.YYY.235:80 gate
service=http
request="test.html"
receive="Still alive"
scheduler=rr #here i've tried with wlr as well
protocol=tcp
checktype=negotiate

[root [at] linu ~]# /usr/sbin/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.186-ha-2.1.4 with pid: 18619
Starting Linux Director v1.186-ha-2.1.4 with pid: 18619
DEBUG2: Running system(/sbin/ipvsadm -A -t XX.XX.XX.236:80 -s rr )
Running system(/sbin/ipvsadm -A -t XX.XX.XX.236:80 -s rr )
DEBUG2: Added virtual server: XX.XX.XX.236:80
Added virtual server: XX.XX.XX.236:80
DEBUG2: Running system(/sbin/ipvsadm -a -t XX.XX.XX.236:80 -r 127.0.0.1:80
-g -w 1)
Running system(/sbin/ipvsadm -a -t XX.XX.XX.236:80 -r 127.0.0.1:80 -g -w 1)
DEBUG2: Added fallback server: 127.0.0.1:80 (XX.XX.XX.236:80) (Weight set to
1)
Added fallback server: 127.0.0.1:80 (XX.XX.XX.236:80) (Weight set to 1)
DEBUG2: Disabled real
server=negotiate:http:tcp:XX.XX.XX.235:80:::1:gate:\/test\.html:Still\ alive
(virtual=tcp:XX.XX.XX.236:80)
DEBUG2: Checking negotiate: real
server=negotiate:http:tcp:XX.XX.XX.235:80:::1:gate:\/test\.html:Still\ alive
(virtual=tcp:XX.XX.XX.236:80)
DEBUG2: check_http: url="http://XX.XX.XX.235:80/test.html"
virtualhost="XX.XX.XX.235"
LWP::UserAgent::new: ()
DEBUG2: Starting Check
DEBUG2: Starting HTTP/HTTPS
LWP::UserAgent::request: ()
LWP::UserAgent::send_request: GET http://XX.XX.XX.235:80/test.html
LWP::UserAgent::_need_proxy: Not proxied
LWP::Protocol::http::request: ()
LWP::Protocol::collect: read 12 bytes
LWP::UserAgent::request: Simple response: OK
DEBUG2: Finished HTTP/HTTPS
DEBUG2: Running system(/sbin/ipvsadm -a -t XX.XX.XX.236:80 -r
XX.XX.XX.235:80 -g -w 1)
Running system(/sbin/ipvsadm -a -t XX.XX.XX.236:80 -r XX.XX.XX.235:80 -g -w
1)
DEBUG2: system(/sbin/ipvsadm -a -t XX.XX.XX.236:80 -r XX.XX.XX.235:80 -g -w
1) failed: No child processes
system(/sbin/ipvsadm -a -t XX.XX.XX.236:80 -r XX.XX.XX.235:80 -g -w 1)
failed: No child processes
DEBUG2: Added real server: XX.XX.XX.235:80 (XX.XX.XX.236:80) (Weight set to
1)
Added real server: XX.XX.XX.235:80 (XX.XX.XX.236:80) (Weight set to 1)
DEBUG2: Running system(/sbin/ipvsadm -d -t XX.XX.XX.236:80 -r 127.0.0.1:80)
Running system(/sbin/ipvsadm -d -t XX.XX.XX.236:80 -r 127.0.0.1:80)
DEBUG2: system(/sbin/ipvsadm -d -t XX.XX.XX.236:80 -r 127.0.0.1:80) failed:
No child processes
system(/sbin/ipvsadm -d -t XX.XX.XX.236:80 -r 127.0.0.1:80) failed: No child
processes
DEBUG2: Deleted fallback server: 127.0.0.1:80 (XX.XX.XX.236:80)
Deleted fallback server: 127.0.0.1:80 (XX.XX.XX.236:80)
DEBUG2: Enabled real
server=negotiate:http:tcp:XX.XX.XX.235:80:::1:gate:\/test\.html:Still\ alive
(virtual=tcp:XX.XX.XX.236:80)
DEBUG2: check_http: http://XX.XX.XX.235:80/test.html is up

If i go to the webserver i can see that ldirector is actually testing the
test.html..every 10 seconds like in the conf

-----------------------------------------------

I am sure that is because of the configurations of the IPs and the aditional
eth0:0 and lo:0 and that's why it doesn't work, i will paste everything that
i did, maybe, just maybe you can help me out on this one, i'm really
stuck..probably because i don't know lots of stuff on how the OSI layer is
build and how arp works

Aditional Network conf..
XX.XX.XX.234 (this is the lvs..) is spawned on eth1..
so i spawned another eth1:0
[root [at] linu ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1:0
DEVICE=eth1:0
IPADDR=XX.XX.XX.236 # this is from the same subnet and i doesn't conflict
with an existent one
NETMASK=255.255.255.0
NETWORK=XX.XX.XX.0
BROADCAST=XX.XX.XX.255
GATEWAY=XX.XX.XX.233 # i've put the same gateway as the default ip
XX.XX.XX.234 had
ONBOOT=yes

i also enabled port forwarding

net.ipv4.ip_forward = 1
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296

And i did the modprobe with all those modules for IPV

modprobe ip_vs_dh
modprobe ip_vs_ftp
modprobe ip_vs_dh
modprobe ip_vs_ftp
modprobe ip_vs
modprobe ip_vs_lblc
modprobe ip_vs_lblcr
modprobe ip_vs_lc
modprobe ip_vs_nq
modprobe ip_vs_rr
modprobe ip_vs_sed
modprobe ip_vs_sh
modprobe ip_vs_wlc
modprobe ip_vs_wrr

and that's all i did for the LVS server..

Now for the webserver
XX.XX.XX.235 (this is the lvs..) is spawned on eth0..
root [at] linu ~]# cat /etc/sysconfig/network-scripts/ifcfg-lo:0
DEVICE=lo:0
IPADDR=XX.XX.XX.236
NETMASK=255.255.255.255
NETWORK=XX.XX.XX.XX.0
BROADCAST=XX.XX.XX.255
ONBOOT=yes
NAME=loopback

and

net.ipv4.ip_forward = 0
net.ipv4.conf.lo.arp_ignore = 1 #here i have tried with eth0 instead of
lo, no luck..
net.ipv4.conf.lo.arp_announce = 2 #here i have tried with eth0 instead of
lo, no luck..
net.ipv4.conf.all.arp_ignore = 1
net.ipv4.conf.all.arp_announce = 2
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296

here i've tried with ip forward 0 and 1 , no luck the requests simply don't
reach this server only the direct ones

Now i've understand that this is an ARP problem, and as CentOS doesn't
support the arp hidden flag on sysctl , i tried with
/etc/init.d/arptables_jf

arptables -A IN -j DROP -d XX.XX.XX.236
-A OUT -j mangle -o eth0 -s XX.XX.XX.234 --mangle-ip-s XX.XX.XX.236
arptables -A OUT -j mangle -o eth0 -s XX.XX.XX.234 --mangle-ip-s
XX.XX.XX.236
/etc/init.d/arptables_jf save
/etc/init.d/arptables_jf start
/sbin/arptables -L -v -n

hain IN (policy ACCEPT 1353 packets, 37884 bytes)
pkts bytes target in out source-ip destination-ip
source-hw destination-hw hlen op hrd pro
0 0 DROP * * 0.0.0.0/0 XX.XX.XX.236
00/00 00/00 any 0000/0000 0000/0000 0000/0000

Chain OUT (policy ACCEPT 25 packets, 700 bytes)
pkts bytes target in out source-ip destination-ip
source-hw destination-hw hlen op hrd pro
0 0 mangle * eth0 XX.XX.XX.234 0.0.0.0/0
00/00 00/00 any 0000/0000 0000/0000 0000/0000
--mangle-ip-s XX.XX.XX.236

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target in out source-ip destination-ip
source-hw destination-hw hlen op hrd pro

-----------------------------------------------

i've probed with ipvsadm or something like it, to see the active
connections, and they are always to 0

i've modprobed here the same modules, no luck..

So from this point i'm really stuck and don't know what to do...

Here's the ifconfig from both servers if that helps
from the LVS (xx.234)

eth1 Link encap:Ethernet HWaddr 00:1B:21:46:3E:A9
inet addr:XX.XX.XX.234 Bcast:XX.XX.XX.239 Mask:255.255.255.248
inet6 addr: fe80::21b:21ff:fe45:3ea9/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:276338 errors:0 dropped:2 overruns:0 frame:0
TX packets:220590 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:156995116 (149.7 MiB) TX bytes:30754525 (29.3 MiB)
Base address:0xd000 Memory:e2020000-e2040000

eth1:0 Link encap:Ethernet HWaddr 00:1B:21:46:3E:A9
inet addr:XX.XX.XX.236 Bcast:XX.XX.XX.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Base address:0xd000 Memory:e2020000-e2040000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:150 errors:0 dropped:0 overruns:0 frame:0
TX packets:150 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:16592 (16.2 KiB) TX bytes:16592 (16.2 KiB)

here's the one from the webserver

eth0 Link encap:Ethernet HWaddr 00:24:1D:72:61:AB
inet addr:XX.XX.XX.235 Bcast:XX.XX.XX.239 Mask:255.255.255.248
inet6 addr: fe80::224:1dff:fe74:61ab/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:301529 errors:0 dropped:0 overruns:0 frame:0
TX packets:255827 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:149822776 (142.8 MiB) TX bytes:36393789 (34.7 MiB)
Interrupt:233 Base address:0x2000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:56 errors:0 dropped:0 overruns:0 frame:0
TX packets:56 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4448 (4.3 KiB) TX bytes:4448 (4.3 KiB)

lo:0 Link encap:Local Loopback
inet addr:XX.XX.XX.236 Mask:255.255.255.255
UP LOOPBACK RUNNING MTU:16436 Metric:1

I thank you in advance for helping solve this problem. I think it's a
problem that many have with Fedora/Red Hat/ Cent-oS


L.S. Keijser-2 wrote:
>
> On Wed, 2009-10-21 at 22:20 -0700, partysoft wrote:
>> Hello, i've been trying to setup on Centos 5 LdirectorD without
>> Heartbeat,
>> and everything seems to work but no redirection, the RealServers arren't
>> reached....
>
>>From where? The director? The client? How did you come to this
> conclusion; packet sniffing, realserver logfiles, something else?
>
>> The thing i don't understand is this: will All the servers have to be in
>> LAN
>> using a 192.XXX ips?
>
> Depends on what you're trying to do.
>
>> I actually have all the servers with a public IP, and no way to put them
>> in
>> LAN , i understood that i should use ipip (TUN) method, but i there isn't
>> a
>> good doc out there how to setup the tun0 on the servers, and stuff like
>> that
>>
>> What if i put them in VPN will that simulate a LAN an let the gate method
>> work? i plan to use OpenVpn (that actually is through Tun)
>>
>> Or is it because i haven't used Heartbeat service to spawn ldirectord?
>> i'm
>> completly lost..
>
> Yes, it seems so :) Why don't you start by reading the HOWTO? If you
> have realservers with a public IP and your director with a public IP in
> the same subnet, you could try setting up LVS-DR. It requires for you to
> add a loopback device on the realservers and, depending on the OS, solve
> the arp problem.
>
> http://www.austintek.com/LVS/LVS-HOWTO/HOWTO/
>
> LVS-TUN is probably not what you want. Heartbeat and ldirectord are used
> mainly for when you're setting up a failover cluster with 2 or more
> directors. The best way to learn LVS is to set up the IPVS table
> manually so later you know what ldirector automagically does for you :)
>
> --
> Léon
>
>
> _______________________________________________
> Please read the documentation before posting - it's available at:
> http://www.linuxvirtualserver.org/
>
> LinuxVirtualServer.org mailing list - lvs-users [at] LinuxVirtualServer
> Send requests to lvs-users-request [at] LinuxVirtualServer
> or go to http://lists.graemef.net/mailman/listinfo/lvs-users
>

--
View this message in context: http://www.nabble.com/LdirectorD-LVS-and-CentOS-Fedora-RedHat-tp26004219p26015972.html
Sent from the LVS mailing list archive at Nabble.com.


_______________________________________________
Please read the documentation before posting - it's available at:
http://www.linuxvirtualserver.org/

LinuxVirtualServer.org mailing list - lvs-users [at] LinuxVirtualServer
Send requests to lvs-users-request [at] LinuxVirtualServer
or go to http://lists.graemef.net/mailman/listinfo/lvs-users


leon at linux

Oct 22, 2009, 2:22 PM

Post #6 of 11 (1530 views)
Permalink
Re: [lvs-users] LdirectorD LVS and CentOS/Fedora/RedHat [In reply to]

Hi,

I'm replying to you and to the lvs-users list so everyone can
participate and help. It's a fairly long reply with detailed
instructions on how to get it working. I could just point you to the
HOWTO (as i already did) but i'm in a good mood. Also, since it's so
long and detailed, i hope i got it right else it's a waste of time :P

Oh and i'm going to make a lot of assumptions while replying, so please
correct me if i'm wrong:

On Thu, 2009-10-22 at 12:38 -0700, partysoft [at] gmail wrote:
> Thank you Léon for the reply. I apreciate it so much.
> Yes i actually have 3 public ip's like (none are with 192..)
> XX.XX.XX.234 (this is the lvs..)

by 'the lvs' i assume you mean 'the director'

> XX.XX.XX.235 real server (web ngix)
> YYY.YYY.YYY.163 real server (web apache) - I don't really care about this one, i can move it into the

into the .. ? cat caught your tongue? :P

> we will use XX.XX.XX.236 as virtual..(there isn't an ip on the net with that number up). of course it will be simpler to use a 192.. but, i have tried that also ,and no luck

I assume that by 'virtual' you mean Virtual IP configured on the
director.

> same subnet as the first 2 ones, i just want to make it work from the 234 -> 235..but it gives me a timeout on the browser...

You mean from .236 -> .235 because clients won't connect to the IP of
the director. Instead they'll connect to the VIP.

> Here's what i did:
>
> [root [at] linu ~]# cat /etc/ha.d/ldirectord.cf
> checktimeout=3
> checkinterval=10
> autoreload=yes
> logfile="/var/log/ldirectord.log"
> quiescent=no

I'm not sure 'quiescent=no' is a valid option in ldirectord.cf .. What
were you trying to accomplish here?

> virtual=XX.XX.XX.236:80
> fallback=127.0.0.1:80
> real=XX.XX.XX.235:80 gate
> real=YYY.YYY.YYY.235:80 gate

Where does the YYY.YYY.YYY.235 come from? Assuming X != Y, this will
never work as the two realservers are in different subnets. Again i'm
assuming this because of your ifconfig post later in this mail. Either
move the 2nd realserver into the subnet, leave it out, or extend your
subnet to include it (probably not possible).

> service=http
> request="test.html"
> receive="Still alive"
> scheduler=rr #here i've tried with172.18.24.15 wlr as well

The scheduler is irrelevant for now. Let's just first try to get it
working period. Anyway, 'wlr'? I'm not even sure this is a valid
scheduler. Don't you mean 'wlc' or 'wrr'? :)

> protocol=tcp
> checktype=negotiate
>
> [root [at] linu ~]# /usr/sbin/ldirectord -d /etc/ha.d/ldirectord.cf start

It's better (to learn LVS) if you don't use ldirectord for now, but ok,
let's try it anyway :P

-snip heartbeat output-

> If i go to the webserver i can see that ldirector is actually testing the test.html..every 10 seconds like in the conf

Good, at least the director can access one of the realservers.

> I am sure that is because of the configurations of the IPs and the aditional eth0:0 and lo:0 and that's why it doesn't work, i will paste everything that i did, maybe, just maybe you can help me out on this one, i'm really stuck..probably because i don't know lots of stuff on how the OSI layer is build and how arp works

Okay, tiny summary of what's supposed to happen in LVS-DR:

1) client sends request to VIP
2) director receives packet, checks LVS table for available realserver
and forwards the packet to it without changing destination_ip
3) realserver receives packet and sees destination_ip matches the
configured ip on its loopback device
4) realserver handles request and replies to src_address (the original
client) thereby using its default gateway, bypassing the director
5) client receives reply

What probably happened is that you didn't solve the ARP problem and
instead of receiving a reply from the IP configured on the realserver's
loopback device (that's the VIP, the same one configured on the
director), the realserver's RIP replies to the client. Your client never
sent a request to _that_ IP so it drops the packet, endlessly waiting
for a reply from the VIP.

> Aditional Network conf..
> XX.XX.XX.234 (this is the lvs..) is spawned on eth1..
> so i spawned another eth1:0
> [root [at] linu ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1:0
> DEVICE=eth1:0
> IPADDR=XX.XX.XX.236 # this is from the same subnet and i doesn't conflict with an existent one
> NETMASK=255.255.255.0
> NETWORK=XX.XX.XX.0
> BROADCAST=XX.XX.XX.255
> GATEWAY=XX.XX.XX.233 # i've put the same gateway as the default ip XX.XX.XX.234 had
> ONBOOT=yes
>
> i also enabled port forwarding

Port forwarding isn't required for LVS-DR.

> net.ipv4.ip_forward = 1
> net.ipv4.conf.default.rp_filter = 1
> net.ipv4.conf.default.accept_source_route = 0
> kernel.sysrq = 0
> kernel.core_uses_pid = 1
> net.ipv4.tcp_syncookies = 1
> kernel.msgmnb = 65536
> kernel.msgmax = 65536
> kernel.shmmax = 68719476736
> kernel.shmall = 4294967296
>
> And i did the modprobe with all those modules for IPV
>
> modprobe ip_vs_dh
> modprobe ip_vs_ftp
> modprobe ip_vs_dh
> modprobe ip_vs_ftp
> modprobe ip_vs
> modprobe ip_vs_lblc
> modprobe ip_vs_lblcr
> modprobe ip_vs_lc
> modprobe ip_vs_nq
> modprobe ip_vs_rr
> modprobe ip_vs_sed
> modprobe ip_vs_sh
> modprobe ip_vs_wlc
> modprobe ip_vs_wrr

IPVS will load the module it requires for the configured scheduler
automatically. It's not necessary to load any module manually.

> and that's all i did for the LVS server..
>
> Now for the webserver
> XX.XX.XX.235 (this is the lvs..) is spawned on eth0..
> root [at] linu ~]# cat /etc/sysconfig/network-scripts/ifcfg-lo:0
> DEVICE=lo:0
> IPADDR=XX.XX.XX.236
> NETMASK=255.255.255.255
> NETWORK=XX.XX.XX.XX.0
> BROADCAST=XX.XX.XX.255
> ONBOOT=yes
> NAME=loopback

AFAIK it's best not to use the sysconfig scripts to create the loopback
device on the realserver. RedHat does an ARPING to determine if the
interface you're trying to configure is already up. It might confuse
things. You could just as easily configure everything
from /etc/rc.local. See below the next bit:

> and
>
> net.ipv4.ip_forward = 0
> net.ipv4.conf.lo.arp_ignore = 1 #here i have tried with eth0 instead of lo, no luck..
> net.ipv4.conf.lo.arp_announce = 2 #here i have tried with eth0 instead of lo, no luck..
> net.ipv4.conf.all.arp_ignore = 1
> net.ipv4.conf.all.arp_announce = 2

Okay, you're starting okay in trying to solve the ARP problem. But
you're really not... Configure arp ignore/announce and the loopback
device from within /etc/rc.local like this:

# solve the 'ARP problem'
echo 1 > /proc/sys/net/ipv4/conf/lo/arp_ignore
echo 1 > /proc/sys/net/ipv4/conf/eth0/arp_ignore
echo 2 > /proc/sys/net/ipv4/conf/lo/arp_announce
echo 2 > /proc/sys/net/ipv4/conf/eth0/arp_announce
/sbin/ifconfig lo:0 XX.XX.XX.236 netmask 255.255.255.255 up

(reboot your realserver after this, or bring down lo:0 and
run /etc/rc.local)

> net.ipv4.conf.default.rp_filter = 1
> net.ipv4.conf.default.accept_source_route = 0
> kernel.sysrq = 0
> kernel.core_uses_pid = 1
> net.ipv4.tcp_syncookies = 1
> kernel.msgmnb = 65536
> kernel.msgmax = 65536
> kernel.shmmax = 68719476736
> kernel.shmall = 4294967296
>
> here i've tried with ip forward 0 and 1 , no luck the requests simply don't reach this server only the direct ones

You don't configure ip_forward on the realservers.

>
> Now i've understand that this is an ARP problem, and as CentOS doesn't support the arp hidden flag on sysctl , i tried with /etc/init.d/arptables_jf

-snip arptables output-

Again, assuming you have a fairly recent kernel, you don't need
arptables. Just for fun, please post your kernel version.

> -----------------------------------------------
>
> i've probed with ipvsadm or something like it, to see the active connections, and they are always to 0
>
> i've modprobed here the same modules, no luck..
>
> So from this point i'm really stuck and don't know what to do...
>
> Here's the ifconfig from both servers if that helps
> from the LVS (xx.234)
>
> eth1 Link encap:Ethernet HWaddr 00:1B:21:46:3E:A9
> inet addr:XX.XX.XX.234 Bcast:XX.XX.XX.239 Mask:255.255.255.248

Okay, this pretty much rules out the possibility that both your
realservers are in the same subnet, so fix that first by either removing
one that isn't in the same subnet as the director, or by moving it into
the subnet.

> eth1:0 Link encap:Ethernet HWaddr 00:1B:21:46:3E:A9
> inet addr:XX.XX.XX.236 Bcast:XX.XX.XX.255 Mask:255.255.255.0

Your configured VIP is in a different subnet than your real IP. Probably
doesn't matter much in this case though, but still..

-snip rest of output-

> here's the one from the webserver
>
> eth0 Link encap:Ethernet HWaddr 00:24:1D:72:61:AB
> inet addr:XX.XX.XX.235 Bcast:XX.XX.XX.239 Mask:255.255.255.248

-snip rest of eth0 and lo output-

> lo:0 Link encap:Local Loopback
> inet addr:XX.XX.XX.236 Mask:255.255.255.255
> UP LOOPBACK RUNNING MTU:16436 Metric:1

Good, it has the VIP configured.

So after all these changes/checks/reboots, run this command from a
client (not the director or any of the realservers!) :

$ arping XX.XX.XX.236

You should get a reply from 00:1B:21:46:3E:A9 (MAC on the director). If
you get any reply from 00:24:1D:72:61:AB (MAC on the realserver) you
haven't solved the ARP problem yet. Assuming (here we go again) that you
have now configured the lo:0 on the realserver correctly (and removed it
from /etc/sysconfig/network-scripts/ifcfg-lo:0 !!), clear the arp cache
on the client:

$ arp -d XX.XX.XX.236

and try the arping command again.

Also, disable any firewalls on both director and realservers while
setting things up. You can always later lock it down (while keeping an
eye on functionality). This way it won't disturb setting up LVS.

And if you rather not use ldirectord (recommended for first-time usage):

$ service ldirectord stop
$ ipvsadm -A -t XX.XX.XX.236:80 -s rr
$ ipvsadm -a -t XX.XX.XX.236:80 -r XX.XX.XX.235:80 -g -w 1

Then from a client (not the director or realserver) try it out:

$ telnet XX.XX.XX.236 80

If you get a response like this:

Trying XX.XX.XX.236...
Connected to XX.XX.XX.236.
Escape character is '^]'.

Then it's working.

Good luck :)

--
Léon


_______________________________________________
Please read the documentation before posting - it's available at:
http://www.linuxvirtualserver.org/

LinuxVirtualServer.org mailing list - lvs-users [at] LinuxVirtualServer
Send requests to lvs-users-request [at] LinuxVirtualServer
or go to http://lists.graemef.net/mailman/listinfo/lvs-users


partysoft at gmail

Oct 22, 2009, 3:21 PM

Post #7 of 11 (1521 views)
Permalink
Re: [lvs-users] LdirectorD LVS and CentOS/Fedora/RedHat [In reply to]

Wow, i'm going to try all this and tell you tomorrow how did it go. You're a
genious by the way
Thank you a lot


L.S. Keijser-2 wrote:
>
> Hi,
>
> I'm replying to you and to the lvs-users list so everyone can
> participate and help. It's a fairly long reply with detailed
> instructions on how to get it working. I could just point you to the
> HOWTO (as i already did) but i'm in a good mood. Also, since it's so
> long and detailed, i hope i got it right else it's a waste of time :P
>
> Oh and i'm going to make a lot of assumptions while replying, so please
> correct me if i'm wrong:
>
> On Thu, 2009-10-22 at 12:38 -0700, partysoft [at] gmail wrote:
>> Thank you Léon for the reply. I apreciate it so much.
>> Yes i actually have 3 public ip's like (none are with 192..)
>> XX.XX.XX.234 (this is the lvs..)
>
> by 'the lvs' i assume you mean 'the director'
>
>> XX.XX.XX.235 real server (web ngix)
>> YYY.YYY.YYY.163 real server (web apache) - I don't really care about
>> this one, i can move it into the
>
> into the .. ? cat caught your tongue? :P
>
>> we will use XX.XX.XX.236 as virtual..(there isn't an ip on the net with
>> that number up). of course it will be simpler to use a 192.. but, i have
>> tried that also ,and no luck
>
> I assume that by 'virtual' you mean Virtual IP configured on the
> director.
>
>> same subnet as the first 2 ones, i just want to make it work from the 234
>> -> 235..but it gives me a timeout on the browser...
>
> You mean from .236 -> .235 because clients won't connect to the IP of
> the director. Instead they'll connect to the VIP.
>
>> Here's what i did:
>>
>> [root [at] linu ~]# cat /etc/ha.d/ldirectord.cf
>> checktimeout=3
>> checkinterval=10
>> autoreload=yes
>> logfile="/var/log/ldirectord.log"
>> quiescent=no
>
> I'm not sure 'quiescent=no' is a valid option in ldirectord.cf .. What
> were you trying to accomplish here?
>
>> virtual=XX.XX.XX.236:80
>> fallback=127.0.0.1:80
>> real=XX.XX.XX.235:80 gate
>> real=YYY.YYY.YYY.235:80 gate
>
> Where does the YYY.YYY.YYY.235 come from? Assuming X != Y, this will
> never work as the two realservers are in different subnets. Again i'm
> assuming this because of your ifconfig post later in this mail. Either
> move the 2nd realserver into the subnet, leave it out, or extend your
> subnet to include it (probably not possible).
>
>> service=http
>> request="test.html"
>> receive="Still alive"
>> scheduler=rr #here i've tried with172.18.24.15 wlr as well
>
> The scheduler is irrelevant for now. Let's just first try to get it
> working period. Anyway, 'wlr'? I'm not even sure this is a valid
> scheduler. Don't you mean 'wlc' or 'wrr'? :)
>
>> protocol=tcp
>> checktype=negotiate
>>
>> [root [at] linu ~]# /usr/sbin/ldirectord -d /etc/ha.d/ldirectord.cf start
>
> It's better (to learn LVS) if you don't use ldirectord for now, but ok,
> let's try it anyway :P
>
> -snip heartbeat output-
>
>> If i go to the webserver i can see that ldirector is actually testing the
>> test.html..every 10 seconds like in the conf
>
> Good, at least the director can access one of the realservers.
>
>> I am sure that is because of the configurations of the IPs and the
>> aditional eth0:0 and lo:0 and that's why it doesn't work, i will paste
>> everything that i did, maybe, just maybe you can help me out on this one,
>> i'm really stuck..probably because i don't know lots of stuff on how the
>> OSI layer is build and how arp works
>
> Okay, tiny summary of what's supposed to happen in LVS-DR:
>
> 1) client sends request to VIP
> 2) director receives packet, checks LVS table for available realserver
> and forwards the packet to it without changing destination_ip
> 3) realserver receives packet and sees destination_ip matches the
> configured ip on its loopback device
> 4) realserver handles request and replies to src_address (the original
> client) thereby using its default gateway, bypassing the director
> 5) client receives reply
>
> What probably happened is that you didn't solve the ARP problem and
> instead of receiving a reply from the IP configured on the realserver's
> loopback device (that's the VIP, the same one configured on the
> director), the realserver's RIP replies to the client. Your client never
> sent a request to _that_ IP so it drops the packet, endlessly waiting
> for a reply from the VIP.
>
>> Aditional Network conf..
>> XX.XX.XX.234 (this is the lvs..) is spawned on eth1..
>> so i spawned another eth1:0
>> [root [at] linu ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1:0
>> DEVICE=eth1:0
>> IPADDR=XX.XX.XX.236 # this is from the same subnet and i doesn't
>> conflict with an existent one
>> NETMASK=255.255.255.0
>> NETWORK=XX.XX.XX.0
>> BROADCAST=XX.XX.XX.255
>> GATEWAY=XX.XX.XX.233 # i've put the same gateway as the default ip
>> XX.XX.XX.234 had
>> ONBOOT=yes
>>
>> i also enabled port forwarding
>
> Port forwarding isn't required for LVS-DR.
>
>> net.ipv4.ip_forward = 1
>> net.ipv4.conf.default.rp_filter = 1
>> net.ipv4.conf.default.accept_source_route = 0
>> kernel.sysrq = 0
>> kernel.core_uses_pid = 1
>> net.ipv4.tcp_syncookies = 1
>> kernel.msgmnb = 65536
>> kernel.msgmax = 65536
>> kernel.shmmax = 68719476736
>> kernel.shmall = 4294967296
>>
>> And i did the modprobe with all those modules for IPV
>>
>> modprobe ip_vs_dh
>> modprobe ip_vs_ftp
>> modprobe ip_vs_dh
>> modprobe ip_vs_ftp
>> modprobe ip_vs
>> modprobe ip_vs_lblc
>> modprobe ip_vs_lblcr
>> modprobe ip_vs_lc
>> modprobe ip_vs_nq
>> modprobe ip_vs_rr
>> modprobe ip_vs_sed
>> modprobe ip_vs_sh
>> modprobe ip_vs_wlc
>> modprobe ip_vs_wrr
>
> IPVS will load the module it requires for the configured scheduler
> automatically. It's not necessary to load any module manually.
>
>> and that's all i did for the LVS server..
>>
>> Now for the webserver
>> XX.XX.XX.235 (this is the lvs..) is spawned on eth0..
>> root [at] linu ~]# cat /etc/sysconfig/network-scripts/ifcfg-lo:0
>> DEVICE=lo:0
>> IPADDR=XX.XX.XX.236
>> NETMASK=255.255.255.255
>> NETWORK=XX.XX.XX.XX.0
>> BROADCAST=XX.XX.XX.255
>> ONBOOT=yes
>> NAME=loopback
>
> AFAIK it's best not to use the sysconfig scripts to create the loopback
> device on the realserver. RedHat does an ARPING to determine if the
> interface you're trying to configure is already up. It might confuse
> things. You could just as easily configure everything
> from /etc/rc.local. See below the next bit:
>
>> and
>>
>> net.ipv4.ip_forward = 0
>> net.ipv4.conf.lo.arp_ignore = 1 #here i have tried with eth0 instead of
>> lo, no luck..
>> net.ipv4.conf.lo.arp_announce = 2 #here i have tried with eth0 instead
>> of lo, no luck..
>> net.ipv4.conf.all.arp_ignore = 1
>> net.ipv4.conf.all.arp_announce = 2
>
> Okay, you're starting okay in trying to solve the ARP problem. But
> you're really not... Configure arp ignore/announce and the loopback
> device from within /etc/rc.local like this:
>
> # solve the 'ARP problem'
> echo 1 > /proc/sys/net/ipv4/conf/lo/arp_ignore
> echo 1 > /proc/sys/net/ipv4/conf/eth0/arp_ignore
> echo 2 > /proc/sys/net/ipv4/conf/lo/arp_announce
> echo 2 > /proc/sys/net/ipv4/conf/eth0/arp_announce
> /sbin/ifconfig lo:0 XX.XX.XX.236 netmask 255.255.255.255 up
>
> (reboot your realserver after this, or bring down lo:0 and
> run /etc/rc.local)
>
>> net.ipv4.conf.default.rp_filter = 1
>> net.ipv4.conf.default.accept_source_route = 0
>> kernel.sysrq = 0
>> kernel.core_uses_pid = 1
>> net.ipv4.tcp_syncookies = 1
>> kernel.msgmnb = 65536
>> kernel.msgmax = 65536
>> kernel.shmmax = 68719476736
>> kernel.shmall = 4294967296
>>
>> here i've tried with ip forward 0 and 1 , no luck the requests simply
>> don't reach this server only the direct ones
>
> You don't configure ip_forward on the realservers.
>
>>
>> Now i've understand that this is an ARP problem, and as CentOS doesn't
>> support the arp hidden flag on sysctl , i tried with
>> /etc/init.d/arptables_jf
>
> -snip arptables output-
>
> Again, assuming you have a fairly recent kernel, you don't need
> arptables. Just for fun, please post your kernel version.
>
>> -----------------------------------------------
>>
>> i've probed with ipvsadm or something like it, to see the active
>> connections, and they are always to 0
>>
>> i've modprobed here the same modules, no luck..
>>
>> So from this point i'm really stuck and don't know what to do...
>>
>> Here's the ifconfig from both servers if that helps
>> from the LVS (xx.234)
>>
>> eth1 Link encap:Ethernet HWaddr 00:1B:21:46:3E:A9
>> inet addr:XX.XX.XX.234 Bcast:XX.XX.XX.239
>> Mask:255.255.255.248
>
> Okay, this pretty much rules out the possibility that both your
> realservers are in the same subnet, so fix that first by either removing
> one that isn't in the same subnet as the director, or by moving it into
> the subnet.
>
>> eth1:0 Link encap:Ethernet HWaddr 00:1B:21:46:3E:A9
>> inet addr:XX.XX.XX.236 Bcast:XX.XX.XX.255 Mask:255.255.255.0
>
> Your configured VIP is in a different subnet than your real IP. Probably
> doesn't matter much in this case though, but still..
>
> -snip rest of output-
>
>> here's the one from the webserver
>>
>> eth0 Link encap:Ethernet HWaddr 00:24:1D:72:61:AB
>> inet addr:XX.XX.XX.235 Bcast:XX.XX.XX.239
>> Mask:255.255.255.248
>
> -snip rest of eth0 and lo output-
>
>> lo:0 Link encap:Local Loopback
>> inet addr:XX.XX.XX.236 Mask:255.255.255.255
>> UP LOOPBACK RUNNING MTU:16436 Metric:1
>
> Good, it has the VIP configured.
>
> So after all these changes/checks/reboots, run this command from a
> client (not the director or any of the realservers!) :
>
> $ arping XX.XX.XX.236
>
> You should get a reply from 00:1B:21:46:3E:A9 (MAC on the director). If
> you get any reply from 00:24:1D:72:61:AB (MAC on the realserver) you
> haven't solved the ARP problem yet. Assuming (here we go again) that you
> have now configured the lo:0 on the realserver correctly (and removed it
> from /etc/sysconfig/network-scripts/ifcfg-lo:0 !!), clear the arp cache
> on the client:
>
> $ arp -d XX.XX.XX.236
>
> and try the arping command again.
>
> Also, disable any firewalls on both director and realservers while
> setting things up. You can always later lock it down (while keeping an
> eye on functionality). This way it won't disturb setting up LVS.
>
> And if you rather not use ldirectord (recommended for first-time usage):
>
> $ service ldirectord stop
> $ ipvsadm -A -t XX.XX.XX.236:80 -s rr
> $ ipvsadm -a -t XX.XX.XX.236:80 -r XX.XX.XX.235:80 -g -w 1
>
> Then from a client (not the director or realserver) try it out:
>
> $ telnet XX.XX.XX.236 80
>
> If you get a response like this:
>
> Trying XX.XX.XX.236...
> Connected to XX.XX.XX.236.
> Escape character is '^]'.
>
> Then it's working.
>
> Good luck :)
>
> --
> Léon
>
>
> _______________________________________________
> Please read the documentation before posting - it's available at:
> http://www.linuxvirtualserver.org/
>
> LinuxVirtualServer.org mailing list - lvs-users [at] LinuxVirtualServer
> Send requests to lvs-users-request [at] LinuxVirtualServer
> or go to http://lists.graemef.net/mailman/listinfo/lvs-users
>

--
View this message in context: http://www.nabble.com/LdirectorD-LVS-and-CentOS-Fedora-RedHat-tp26004219p26018186.html
Sent from the LVS mailing list archive at Nabble.com.


_______________________________________________
Please read the documentation before posting - it's available at:
http://www.linuxvirtualserver.org/

LinuxVirtualServer.org mailing list - lvs-users [at] LinuxVirtualServer
Send requests to lvs-users-request [at] LinuxVirtualServer
or go to http://lists.graemef.net/mailman/listinfo/lvs-users


partysoft at gmail

Oct 22, 2009, 9:40 PM

Post #8 of 11 (1529 views)
Permalink
Re: [lvs-users] LdirectorD LVS and CentOS/Fedora/RedHat [In reply to]

Eurika, you have enlightend me so now all works, i am able to get to the
realserver through the Virtual IP configured on the director that i've
setup with ldirectord, actually i think i'm being a little stupid since i've
always tried with the actual public ip of the LVS, not the eth1:0 spwaned ip
on the browser, so when you pointed that up it became very clear..

The thing with arping is very helpful so it actually tells you if you are
doing things wright or wrong

oh the Kerner version is :
Linux linux.local 2.6.18-164.el5 #1 SMP Thu Sep 3 03:28:30 EDT 2009 x86_64
x86_64 x86_64 GNU/Linux

Still one problem remains which i haven't put so much accent on the previous
mail ..
the 2 ip's from the 2 different C class nets..


>> virtual=XX.XX.XX.236:80 (Virtual IP configured on the director)
>> fallback=127.0.0.1:80
>> real=XX.XX.XX.235:80 gate
>> real=XX.XX.YY.163:80 gate

>Where does the YYY.YYY.YYY.235 come from? Assuming X != Y, this will
>never work as the two realservers are in different subnets

actually i have the first real server is in the same C class as the LVS
server
so they are (i'm just gonna put some numbers to the X and Y to make it more
clear)
10.1.238.236 (LVS Virtual IP configured on the director), 10.1.238.235 (Real
server)

and the other real server, is the same hosting company i presume and it has
10.1.239.163 so not the same C class...So i don't know if this is posible to
include an ip like that...
I've tried anyway....
What i've tried to do is configure the eth1:0 like this:

eth0:1 Link encap:Ethernet HWaddr 00:24:1D:72:61:AB
inet addr:10.1.238.236 Bcast:10.1.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:233 Base address:0x2000

So it will include the B class as well..

On the RealServer i did like you said ( y renounced to sysctl -p ) :

# solve the 'ARP problem'
echo 1 > /proc/sys/net/ipv4/conf/lo/arp_ignore
echo 1 > /proc/sys/net/ipv4/conf/eth0/arp_ignore
echo 2 > /proc/sys/net/ipv4/conf/lo/arp_announce
echo 2 > /proc/sys/net/ipv4/conf/eth0/arp_announce
/sbin/ifconfig lo:0 XX.XX.XX.236 netmask 255.255.255.255 up

but, when i do an arping XX.XX.XX.236 i get as a response total different
MAC address then the actual one 00:24:1D:72:61:AB

And indeed if i try from the realserver that's on the same C class the x.235
one, i get imediatly the same
00:24:1D:72:61:AB mac address as the eth1:0 has. amazing :) didn't knew i
could do that

by the way i guess on the realservers i don't need to install the lvs
pachages to have the kernel modules installed for lvs, just the arp trick
and that's it..

So again...like a stupid linux rookie that i am , stuck with this
thing...but i'm sure the answer it's between the lines...

Thank you again for your amazing reply, really helped me a lot and possibly
many others that had the same problem



L.S. Keijser-2 wrote:
>
> Hi,
>
> I'm replying to you and to the lvs-users list so everyone can
> participate and help. It's a fairly long reply with detailed
> instructions on how to get it working. I could just point you to the
> HOWTO (as i already did) but i'm in a good mood. Also, since it's so
> long and detailed, i hope i got it right else it's a waste of time :P
>
> Oh and i'm going to make a lot of assumptions while replying, so please
> correct me if i'm wrong:
>
> On Thu, 2009-10-22 at 12:38 -0700, partysoft [at] gmail wrote:
>> Thank you Léon for the reply. I apreciate it so much.
>> Yes i actually have 3 public ip's like (none are with 192..)
>> XX.XX.XX.234 (this is the lvs..)
>
> by 'the lvs' i assume you mean 'the director'
>
>> XX.XX.XX.235 real server (web ngix)
>> YYY.YYY.YYY.163 real server (web apache) - I don't really care about
>> this one, i can move it into the
>
> into the .. ? cat caught your tongue? :P
>
> Yes, i was distracted by my wonderfull non quiet neighbours hahaha
>
>> we will use XX.XX.XX.236 as virtual..(there isn't an ip on the net with
>> that number up). of course it will be simpler to use a 192.. but, i have
>> tried that also ,and no luck
>
>
>

--
View this message in context: http://www.nabble.com/LdirectorD-LVS-and-CentOS-Fedora-RedHat-tp26004219p26020847.html
Sent from the LVS mailing list archive at Nabble.com.


_______________________________________________
Please read the documentation before posting - it's available at:
http://www.linuxvirtualserver.org/

LinuxVirtualServer.org mailing list - lvs-users [at] LinuxVirtualServer
Send requests to lvs-users-request [at] LinuxVirtualServer
or go to http://lists.graemef.net/mailman/listinfo/lvs-users


leon at linux

Oct 23, 2009, 4:44 AM

Post #9 of 11 (1517 views)
Permalink
Re: [lvs-users] LdirectorD LVS and CentOS/Fedora/RedHat [In reply to]

On Thu, 2009-10-22 at 21:40 -0700, partysoft wrote:
> oh the Kerner version is :
> Linux linux.local 2.6.18-164.el5 #1 SMP Thu Sep 3 03:28:30 EDT 2009 x86_64
> x86_64 x86_64 GNU/Linux

I wanted to know in case things weren't working, but this is a recent
enough kernel to allow arp_ignore/arp_announce

> Still one problem remains which i haven't put so much accent on the previous
> mail ..
> the 2 ip's from the 2 different C class nets..
>
>
> >> virtual=XX.XX.XX.236:80 (Virtual IP configured on the director)
> >> fallback=127.0.0.1:80
> >> real=XX.XX.XX.235:80 gate
> >> real=XX.XX.YY.163:80 gate
>
> >Where does the YYY.YYY.YYY.235 come from? Assuming X != Y, this will
> >never work as the two realservers are in different subnets
>
> actually i have the first real server is in the same C class as the LVS
> server
> so they are (i'm just gonna put some numbers to the X and Y to make it more
> clear)
> 10.1.238.236 (LVS Virtual IP configured on the director), 10.1.238.235 (Real
> server)
>
> and the other real server, is the same hosting company i presume and it has
> 10.1.239.163 so not the same C class...So i don't know if this is posible to
> include an ip like that...

No it's not. At least not with LVS-DR. The director needs to be able to
reach the realservers. In the HOWTO (more precisely here:
http://www.austintek.com/LVS/LVS-HOWTO/HOWTO/LVS-HOWTO.LVS-DR.html ) it
says:

"LVS-DR setup and testing is the same as LVS-Tun except that all
machines within the LVS-DR (ie the director and realservers) must be on
the same segment (be able to arp each other). This means that there must
be no forwarding devices between them i.e. they are using the same piece
of transport layer hardware ("wire"), eg RJ-45, coax, fibre (there can
be hub(s) or switch(es) in this mix). Communication within the LVS is by
link-layer, using MAC addresses rather than IP's."


> I've tried anyway....

Try all you want, you're not going to succeed. There's probably a router
somewhere that will stop your efforts.

> What i've tried to do is configure the eth1:0 like this:
>
> eth0:1 Link encap:Ethernet HWaddr 00:24:1D:72:61:AB
> inet addr:10.1.238.236 Bcast:10.1.255.255 Mask:255.255.0.0
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
> Interrupt:233 Base address:0x2000
>
> So it will include the B class as well..
>
> On the RealServer i did like you said ( y renounced to sysctl -p ) :
>
> # solve the 'ARP problem'
> echo 1 > /proc/sys/net/ipv4/conf/lo/arp_ignore
> echo 1 > /proc/sys/net/ipv4/conf/eth0/arp_ignore
> echo 2 > /proc/sys/net/ipv4/conf/lo/arp_announce
> echo 2 > /proc/sys/net/ipv4/conf/eth0/arp_announce
> /sbin/ifconfig lo:0 XX.XX.XX.236 netmask 255.255.255.255 up
>
> but, when i do an arping XX.XX.XX.236 i get as a response total different
> MAC address then the actual one 00:24:1D:72:61:AB

That's probably from a router who basically says "Send the packets to me
and i'll make sure they get to the realserver".

> And indeed if i try from the realserver that's on the same C class the x.235
> one, i get imediatly the same
> 00:24:1D:72:61:AB mac address as the eth1:0 has. amazing :) didn't knew i
> could do that
>
> by the way i guess on the realservers i don't need to install the lvs
> pachages to have the kernel modules installed for lvs, just the arp trick
> and that's it..

And the loopback device ;) And solving the arp problem before bringing
up the lo is important.


> So again...like a stupid linux rookie that i am , stuck with this
> thing...but i'm sure the answer it's between the lines...

You could look at LVS-TUN (see the HOWTO) because AFAIK this is
basically LVS-DR but with the added benefit that you will be able to
bypass routers by encapsulating the packet. I have no experience with
that though.

--
Léon


_______________________________________________
Please read the documentation before posting - it's available at:
http://www.linuxvirtualserver.org/

LinuxVirtualServer.org mailing list - lvs-users [at] LinuxVirtualServer
Send requests to lvs-users-request [at] LinuxVirtualServer
or go to http://lists.graemef.net/mailman/listinfo/lvs-users


partysoft at gmail

Oct 23, 2009, 10:21 AM

Post #10 of 11 (1516 views)
Permalink
Re: [lvs-users] LdirectorD LVS and CentOS/Fedora/RedHat [In reply to]

Yes, well, for the LVS-TUN, seems that almost noone has recomended or tried
that way, but i've heard it's slow, well not as slow as the NAT method
that's the third one and the most lame.. so it's better to ask the hosting
company to move that server into the same node as the other two and problem
solved..

So you've made some points very clear then
>And the loopback device ;) And solving the arp problem before bringing
>up the lo is important.

Always use the virtual addres as the main ip for the domains binded

and the last but not the least for LVS-DR always use the same network (not
routed) for your mini-cluster

Checked and ready to go !

What can i say Léon you have been really helpful and i've really learned a
lot from this, i hope the comunity too.

Now i will move on on building the actual cluster , http, https, nfs (i
don't know actually how to use static file mirroring so i'm thinking of
using nfs to share..but i guess when a server will be to busy serving files,
nfs will be down too) , mysql and ...that's it i think..

Thank you again!


L.S. Keijser-2 wrote:
>
> On Thu, 2009-10-22 at 21:40 -0700, partysoft wrote:
>> oh the Kerner version is :
>> Linux linux.local 2.6.18-164.el5 #1 SMP Thu Sep 3 03:28:30 EDT 2009
>> x86_64
>> x86_64 x86_64 GNU/Linux
>
> I wanted to know in case things weren't working, but this is a recent
> enough kernel to allow arp_ignore/arp_announce
>
>> Still one problem remains which i haven't put so much accent on the
>> previous
>> mail ..
>> the 2 ip's from the 2 different C class nets..
>>
>>
>> >> virtual=XX.XX.XX.236:80 (Virtual IP configured on the director)
>> >> fallback=127.0.0.1:80
>> >> real=XX.XX.XX.235:80 gate
>> >> real=XX.XX.YY.163:80 gate
>>
>> >Where does the YYY.YYY.YYY.235 come from? Assuming X != Y, this will
>> >never work as the two realservers are in different subnets
>>
>> actually i have the first real server is in the same C class as the LVS
>> server
>> so they are (i'm just gonna put some numbers to the X and Y to make it
>> more
>> clear)
>> 10.1.238.236 (LVS Virtual IP configured on the director), 10.1.238.235
>> (Real
>> server)
>>
>> and the other real server, is the same hosting company i presume and it
>> has
>> 10.1.239.163 so not the same C class...So i don't know if this is posible
>> to
>> include an ip like that...
>
> No it's not. At least not with LVS-DR. The director needs to be able to
> reach the realservers. In the HOWTO (more precisely here:
> http://www.austintek.com/LVS/LVS-HOWTO/HOWTO/LVS-HOWTO.LVS-DR.html ) it
> says:
>
> "LVS-DR setup and testing is the same as LVS-Tun except that all
> machines within the LVS-DR (ie the director and realservers) must be on
> the same segment (be able to arp each other). This means that there must
> be no forwarding devices between them i.e. they are using the same piece
> of transport layer hardware ("wire"), eg RJ-45, coax, fibre (there can
> be hub(s) or switch(es) in this mix). Communication within the LVS is by
> link-layer, using MAC addresses rather than IP's."
>
>
>> I've tried anyway....
>
> Try all you want, you're not going to succeed. There's probably a router
> somewhere that will stop your efforts.
>
>> What i've tried to do is configure the eth1:0 like this:
>>
>> eth0:1 Link encap:Ethernet HWaddr 00:24:1D:72:61:AB
>> inet addr:10.1.238.236 Bcast:10.1.255.255 Mask:255.255.0.0
>> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
>> Interrupt:233 Base address:0x2000
>>
>> So it will include the B class as well..
>>
>> On the RealServer i did like you said ( y renounced to sysctl -p ) :
>>
>> # solve the 'ARP problem'
>> echo 1 > /proc/sys/net/ipv4/conf/lo/arp_ignore
>> echo 1 > /proc/sys/net/ipv4/conf/eth0/arp_ignore
>> echo 2 > /proc/sys/net/ipv4/conf/lo/arp_announce
>> echo 2 > /proc/sys/net/ipv4/conf/eth0/arp_announce
>> /sbin/ifconfig lo:0 XX.XX.XX.236 netmask 255.255.255.255 up
>>
>> but, when i do an arping XX.XX.XX.236 i get as a response total different
>> MAC address then the actual one 00:24:1D:72:61:AB
>
> That's probably from a router who basically says "Send the packets to me
> and i'll make sure they get to the realserver".
>
>> And indeed if i try from the realserver that's on the same C class the
>> x.235
>> one, i get imediatly the same
>> 00:24:1D:72:61:AB mac address as the eth1:0 has. amazing :) didn't knew i
>> could do that
>>
>> by the way i guess on the realservers i don't need to install the lvs
>> pachages to have the kernel modules installed for lvs, just the arp trick
>> and that's it..
>
> And the loopback device ;) And solving the arp problem before bringing
> up the lo is important.
>
>
>> So again...like a stupid linux rookie that i am , stuck with this
>> thing...but i'm sure the answer it's between the lines...
>
> You could look at LVS-TUN (see the HOWTO) because AFAIK this is
> basically LVS-DR but with the added benefit that you will be able to
> bypass routers by encapsulating the packet. I have no experience with
> that though.
>
> --
> Léon
>
>
> _______________________________________________
> Please read the documentation before posting - it's available at:
> http://www.linuxvirtualserver.org/
>
> LinuxVirtualServer.org mailing list - lvs-users [at] LinuxVirtualServer
> Send requests to lvs-users-request [at] LinuxVirtualServer
> or go to http://lists.graemef.net/mailman/listinfo/lvs-users
>

--
View this message in context: http://www.nabble.com/LdirectorD-LVS-and-CentOS-Fedora-RedHat-tp26004219p26030303.html
Sent from the LVS mailing list archive at Nabble.com.


_______________________________________________
Please read the documentation before posting - it's available at:
http://www.linuxvirtualserver.org/

LinuxVirtualServer.org mailing list - lvs-users [at] LinuxVirtualServer
Send requests to lvs-users-request [at] LinuxVirtualServer
or go to http://lists.graemef.net/mailman/listinfo/lvs-users


partysoft at gmail

Oct 28, 2009, 9:36 PM

Post #11 of 11 (1424 views)
Permalink
Re: [lvs-users] LdirectorD LVS and CentOS/Fedora/RedHat [In reply to]

Hello Léon, i will post another wierd thing that's happening with the LVS,
you seem to know it all :)

Now i got it working with 1 LVS as server and 1 box as a Real server, both
in LAN
i've added this night the second one...and tried to test what's happening
with the services when they go down... and well.. it simply shows the same
server (the first one i've added) , even if i stop the service..
I have it running with this conf i've posted above.. and each of the real
server have enabled the arp hack

If i use ipvsadm and clear all, and add one at a time..then it works.. if i
add both with weights..then it has some kind of cache.. it's very very
wierd....

I've tested with ldirectord as well...changing the contents of the
test.html, or stopping the http service on one and the other..in the
ldirectord log ,all it's smooth looks like it's detecting the
changes..what's not doing the job is the ipvs

:((((((((((((
--
View this message in context: http://www.nabble.com/LdirectorD-LVS-and-CentOS-Fedora-RedHat-tp26004219p26105474.html
Sent from the LVS mailing list archive at Nabble.com.


_______________________________________________
Please read the documentation before posting - it's available at:
http://www.linuxvirtualserver.org/

LinuxVirtualServer.org mailing list - lvs-users [at] LinuxVirtualServer
Send requests to lvs-users-request [at] LinuxVirtualServer
or go to http://lists.graemef.net/mailman/listinfo/lvs-users

Linux Virtual Server users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.