You are not logged in.

#1 2012-02-09 03:12:34

gghandsome
Member
Registered: 2012-02-09
Posts: 3

problem of keepalived+ipvsadm

Today I want to config a LVS server,
I use this command to install two pack:

pacman -S ipvsadm
pacman -S keepalived

after install I config keepalived run as NLB server for mysql

there is  config file Details:

/etc/keepalived/keepalived.conf

global_defs {
   router_id LVS_DEVEL
}

vrrp_instance VI_1 {
    state MASTER
    interface eth0
    virtual_router_id 51
    priority 100
    advert_int 1
    authentication {
        auth_type PASS
        auth_pass 1111
    }
    virtual_ipaddress {
	192.168.1.230
    }
}

virtual_server 192.168.1.230 3306 {
    delay_loop 6
    lb_algo rr
    lb_kind DR
    nat_mask 255.255.255.0
    protocol TCP

    real_server 192.168.1.201 3306 {
	weight 3
	TCP_CHECK {
		connect_timeout 3
		nb_get_retry 3
		delay_before_retry 3
		connect_port 3306
	}
    }

    real_server 192.168.1.204 3306 {
	weight 3
	TCP_CHECK {
		connect_timeout 3
		nb_get_retry 3
		delay_before_retry 3
		connect_port 3306
	}
    }

after this I start keepalivde service but it can't correct operation.I use ipvsadm -ln viwe the mapping it always only display

IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
  -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP  192.168.1.230:3306 rr
  -> 192.168.1.201:3306           Route   3      2          0

can't find the second server when the second server correct operation.If somebody know any problem of this.

in an other way,I use code pack to install,but I find it can't work with ipvsadm when I compile and install


Keepalived configuration
------------------------
Keepalived version       : 1.2.2
Compiler                 : gcc
Compiler flags           : -g -O2
Extra Lib                : -lpopt -lssl -lcrypto  -lnl
Use IPVS Framework       : No
IPVS sync daemon support : No
Use VRRP Framework       : Yes
Use Debug flags          : No


on CentOS it can install kernel-devel and compile with a option --with-kernel-dir to Solve this problem.but I can't find kernel-devel pack on archlinux,or it names an other.Is there any way to solve this problem on archlinux.

Thanks!!

Offline

#2 2012-07-26 13:40:06

royfall
Member
Registered: 2006-12-09
Posts: 3
Website

Re: problem of keepalived+ipvsadm

I solved this by compiling from the latest github revision. Seems that this version has the required patches to compile against the ip_vs modules with a 3.4.x kernel.

Here is my PKGBUILD: https://dl.dropbox.com/u/3550082/PKGBUILD

NOTE: The files: keepalived.conf, keepalived.service and keepalived.rc must be in the src dir and can be extracted from the community package: http://mirror.archlinux.cl/community/os … pkg.tar.xz

Here is my i686 package with IPVS support: https://dl.dropbox.com/u/3550082/keepal … pkg.tar.xz

sorry for my poor english =P

Last edited by royfall (2012-07-26 13:52:02)

Offline

Board footer

Powered by FluxBB