osixia / docker-keepalived

Keepalived container image 🐳🌴
MIT License
395 stars 143 forks source link

WARNING - equal priority advert received from remote host with our IP address #33

Closed husa570 closed 4 years ago

husa570 commented 4 years ago

Getting this warnings on the master, but I cant see any strange vrrp packets with tcpdump.

WARNING - equal priority advert received from remote host with our IP address.

Keepalive works fine its only filling the log in the master, backup log normal. The warnings logs every second, feels like the master detects its own packets. I have tested several config and versions with the same results. I tried with different prioritys on the two nodes Example of configs with the same behavior

docker run  -d --name keepalive --cap-add=NET_ADMIN --net=host --env KEEPALIVED_UNICAST_PEERS="#PYTHON2BASH:['172.20.95.112', '172.20.95.114']" --env KEEPALIVED_VIRTUAL_IPS="#PYTHON2BASH:['172.20.95.31']" --detach osixia/keepalived:2.0.13
docker run  -d --name keepalive --cap-add=NET_ADMIN --cap-add=NET_BROADCAST --cap-add=NET_RAW --network host --env KEEPALIVED_UNICAST_PEERS="#PYTHON2BASH:['172.20.95.112', '172.20.95.114']" --env KEEPALIVED_VIRTUAL_IPS="#PYTHON2BASH:['172.20.95.31']" --detach osixia/keepalived:2.0.17
docker run  -d --name keepalive --cap-add=NET_ADMIN --cap-add=NET_BROADCAST --cap-add=NET_RAW --env KEEPALIVED_PRIORITY="200" --network host --env KEEPALIVED_UNICAST_PEERS="#PYTHON2BASH:['172.20.95.112', '172.20.95.114']" --env KEEPALIVED_VIRTUAL_IPS="#PYTHON2BASH:['172.20.95.31']" --detach osixia/keepalived:2.0.17
docker run  -d --name keepalive --cap-add=NET_ADMIN --cap-add=NET_BROADCAST --cap-add=NET_RAW --net=host --env KEEPALIVED_UNICAST_PEERS="#PYTHON2BASH:['172.20.95.112', '172.20.95.114']" --env KEEPALIVED_VIRTUAL_IPS="#PYTHON2BASH:['172.20.95.31']" --detach osixia/keepalived:2.0.17
docker run  -d --name keepalive --cap-add=NET_ADMIN --env KEEPALIVED_PRIORITY="200" --network host --env KEEPALIVED_UNICAST_PEERS="#PYTHON2BASH:['172.20.95.112', '172.20.95.114']" --env KEEPALIVED_VIRTUAL_IPS="#PYTHON2BASH:['172.20.95.31']" --detach osixia/keepalived:2.0.17

versions

 cat /etc/os-release
NAME="SLES"
VERSION="12-SP4"
VERSION_ID="12.4"
PRETTY_NAME="SUSE Linux Enterprise Server 12 SP4"
ID="sles"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:suse:sles:12:sp4"
# docker version
Client:
 Version:           19.03.1
 API version:       1.40
 Go version:        go1.12.6
 Git commit:        74b1e89e8ac6
 Built:             Tue Aug  6 15:25:24 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Server:
 Engine:
  Version:          19.03.1
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.6
  Git commit:       74b1e89e8ac6
  Built:            Thu Jul 25 20:38:41 2019
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.2.6
  GitCommit:        894b81a4b802e4eb2a91d1ce216b8817763c29fb
 runc:
  Version:          1.0.0-rc8
  GitCommit:        425e105d5a03fabd737a126ad93d62a9eeede87f
 docker-init:
  Version:          0.1.3_catatonit
  GitCommit:
[infra] root@infra-lbngxk8-01:~ #

Any Idea what I done wrong? Thanks in advance!

cbrherms commented 4 years ago

Oddly i have just started to get the exact same starting yesterday.

meyayl commented 4 years ago

If the node itself is in the KEEPALIVED_UNICAST_PEERS, it gets confused by its own unicast message. I do run a three node setup and had the same issue, when my list included all my three nodes. After removing the node itself from the list, everything returned to expected state.

Though, I would prefer to keep all nodes with the same KEEPALIVED_UNICAST_PEERS values and make the entrypoint script filter out the nodes own ip.

husa570 commented 4 years ago

If the node itself is in the KEEPALIVED_UNICAST_PEERS, it gets confused by its own unicast message. I do run a three node setup and had the same issue, when my list included all my three nodes. After removing the node itself from the list, everything returned to expected state. Though, I would prefer to keep all nodes with the same KEEPALIVED_UNICAST_PEERS values and make the entrypoint script filter out the nodes own ip.

I can confirm that I see the same as @meyayl, for simplify configuration I whould also prefer to have the same keepalive config in both nodes if possible. My "feeling" (or lack of memory) says that it have not always been like this…. same as @cbrherms

cobolbaby commented 4 years ago

How to eliminate the warning?

bulletmark commented 4 years ago

@husa570 can you (or somebody else) please re-open this issue? It is a pain to maintain different keepalived.conf files on every node merely to get rid of this noise which is flooding the log. I would think keepalived should not be sending an advert to itself, or at the very least please suppress the log message for that case.

nick-fox commented 4 years ago

I can confirm that I have this same issue.

drew1kun commented 3 years ago

bump on this.

tomsozolins commented 3 years ago

same problem.

paulliss commented 3 years ago

knock -knock , I've met the same ((

autokilla47 commented 3 years ago

=(

davewat commented 2 years ago

Same issue here after updating to current release.

tc0nn commented 1 year ago

Same issue

notnarb commented 1 year ago

In case anyone else runs into this issue, I came up with a hacky workaround by setting cmd to /bin/sh and args to ["-c", "<the below script>"]

script:

set -eux
# Parse existing ip addresses assigned to specified interface
export IPV4_ADDRESSES=$(ip a show dev $KEEPALIVED_INTERFACE  | grep "inet " | sed -r "s/.*inet ([0-9.]+).*/\1/g")
# Remove each found address from KEEPALIVED_UNICAST_PEERS
for ADDRESS in $IPV4_ADDRESSES; do
# Skip indenting to make python happy.
export KEEPALIVED_UNICAST_PEERS=$(/usr/bin/python3 <<EOF
import ast, os;
existing_list = ast.literal_eval(os.environ["KEEPALIVED_UNICAST_PEERS"].split(":")[1])
filtered_list = list(filter(lambda x: x != "${ADDRESS}", existing_list))
print("#PYTHON2BASH:" + str(filtered_list))
EOF
)
done
exec /container/tool/run

(note: this assumes you're using PYTHON2BASH and only works for IPV4)

I am sure this is somewhat fragile and there is probably a cleaner way of doing this, but basically I just overwrote the entrypoint to remove any assigned IP addresses from ${KEEPALIVED_UNICAST_PEERS} before calling the actual entrypoint.


Would be cool to see something like this upstreamed as an experimental flag since the equivalent logic would probably better fit in startup.sh and passing multi-line variables to Docker can be annoying