Following servers:
....:100::10 mysql1 master
....:100::20 mysql2 master
....:100::30 loadbalancer (keepalived) with virtual ip ...:100::40
Config:
vrrp_instance V1 {
state MASTER
interface eth0
lvs_sync_daemon_inteface eth0
virtual_router_id 51
priority 150
advert_int 1
smtp_alert
virtual_ipaddress {
...:100::40
}
}
virtual_server ...:100::40 3306 {
delay_loop 6
lb_algo wrr
lb_kind DR
protocol TCP
real_server ...:100::10 3306 {
weight 50
TCP_CHECK {
connect_timeout 3
connect_port 3306
}
}
real_server ...:100::20 3306 {
weight 10
TCP_CHECK {
connect_timeout 3
connect_port 3306
}
}
}
The connection directly to both servers are working:
(bind-address = ::
and no ip6tables firewall active)
$ mysql -uroot -p -h...:100::10
Welcome to the MySQL monitor. Commands end with ; or \g.
$ mysql -uroot -p -h...:100::20
Welcome to the MySQL monitor. Commands end with ; or \g.
...:100:30 of course not:
$ mysql -uroot -p -h...:100::30
ERROR 2003 (HY000): Can't connect to MySQL server on '...:100::30' (111)
Unfortunately I get a timeout for ...:100::40
$ mysql -uroot -p -h...:100::40
ERROR 2003 (HY000): Can't connect to MySQL server on '...:100::40' (110)
ipvsadm looks ok to me:
# ipvsadm
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP [...:100::40]:mysql wrr
-> [...:100::10]:mysql Route 50 0 0
# ifconfig
eth0 Link encap:Ethernet HWaddr ..........
inet6 addr: ............/64 Scope:Link
inet6 addr: ...:100::30/64 Scope:Global
inet6 addr: ...:100::40/128 Scope:Global
My problem is now, that keepalived is not listening on port 3306:
# netstat -nlta
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp6 0 0 :::22 :::* LISTEN
tcp6 0 0 ::1:25 :::* LISTEN
# keepalived --help
Keepalived v1.2.2 (12/18,2011)
Where is the fault?