[MXS-3341] Unable to bind on VIP address Created: 2020-12-16  Updated: 2020-12-16  Resolved: 2020-12-16

Status: Closed
Project: MariaDB MaxScale
Component/s: N/A
Affects Version/s: 2.5.5
Fix Version/s: N/A

Type: New Feature Priority: Minor
Reporter: Oleg Kupriyanov Assignee: Unassigned
Resolution: Not a Bug Votes: 0
Labels: None
Environment:

Debian 10.7, keepalived vip



 Description   

Hello!

When using maxscale with keepalived virtual ip there is an error on a backup node:

Starting a total of 1 services...
Failed to bind on '10.0.1.254:4006': 99, Cannot assign requested address
Failed to bind on '10.0.1.254:4006': 99, Cannot assign requested address
Failed to bind on '10.0.1.254:4006': 99, Cannot assign requested address
Failed to bind on '10.0.1.254:4006': 99, Cannot assign requested address
(Read-Write-Listener) One or more workers failed to listen on '[10.0.1.254]:4006'.
Service 'Read-Write-Service' started (1/1)
Failed to start service 'Read-Write-Service'.
Failed to start all MaxScale services.

The error appears because 10.0.1.254 is virtual ip and it assigned on master node. When fail on master node occurs this virtual IP must migrate to backup node. There is a workaround don't bind maxscale to particular ip and use bind 0.0.0.0 but it bad for security reasons.
Can we change bind behavior and allow to bind on non-existent ip-addresses on the backup host?



 Comments   
Comment by markus makela [ 2020-12-16 ]

Google suggests that this is something that can be controlled in the Linux kernel with the following:

sudo sysctl -w net.ipv4.ip_nonlocal_bind=1
sudo sysctl -w net.ipv6.ip_nonlocal_bind=1

Generated at Thu Feb 08 04:20:43 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.