ejabberd cluster node disconnects #271
Closed
opened 2020-12-31 08:56:39 +00:00 by raucao
·
9 comments
No Branch/Tag Specified
Labels
Clear labels
monitoring
bug
design
dev environment
docs
duplicate
enhancement
feature
good first issue
idea
invalid
kredits-1
kredits-2
kredits-3
on hold
ops
question
security
ui/ux
wontfix
service
discourse
Kosmos Community Forums
Infrastructure metrics, alerts, notifications, etc.
service
accounts
Kosmos Accounts
service
drone-ci
Kosmos Drone CI
service
email
mail.kosmos.org
service
garage
S3-compatible object storage
service
gitea
Kosmos Gitea
service
ipfs
Kosmos IPFS
service
mastodon
kosmos.social
service
nostr
Relays, Blossom server, etc.
service
postgres
Database cluster
service
remotestorage
Portable data storage for the Web
service
wiki
Kosmos Wiki
service
xmpp
Kosmos Chat
Something is not working
Graphic/visual design
Config, builds, CI, deployment, etc.
Documentation
This issue or pull request already exists
Improving existing functionality
New functionality
Dive in, and start contributing
Something to consider
Not a bug
Small contribution
Medium contribution
Large contribution
Currently not actionable
Manual IT ops activities
Looking for an answer
release
major
release
minor
release
patch
All your base are belong to us
User interface, process design, etc.
This won't be fixed
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Current operational issues
Solved
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: kosmos/chef#271
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Today, I encountered a cluster without the draco node again. So I have just removed
ejabberd@andromeda.kosmos.orgfrom the cluster, after having removed the DNS record a couple of days ago.I have no idea what caused draco to leave the cluster before, or this time. But I guess if we want to solve it, we need to be notified of when this happens at least (unless someone can find it in the logs already).
Whatever check we would do for this could also automatically re-join the cluster node, of course. But if we want to do that depends on why it's unintentionally leaving I think.
Happened again today, so I wrote a quick Ruby script, and added a cron job that is executed every minute and logging the output to
/root/cron.logfor now:Notify on ejabberd cluster node disconnectsto Investigate/fix ejabberd cluster node disconnectsNot entirely related to the cluster disconnects, but also about disconnects:
wormholeis getting disconnected exactly every hour, on the second sharp, from when it connects to XMPP. Eventually, it fails to re-join MUC rooms then, but without an error or event on the client side. (At least not visible in the wormhole logs.)The session should keep for 24 hours, so I'm wondering if there's an error in that config somewhere.
Just a quick status update on the original issue: the log file is still empty, and the two nodes are still connected.
Log file still empty. TFW you wish something broke so you can know why...
HAProxy on draco failed a bit this morning, so the script finally kicked into action for the first time. Unfortunately, it was missing a
require "date"to actually importDateTimefunctionality. Fixed now. :/OK, so we have some logs now. However, I think even though ejabberd not recovering the cluster by itself is the same issue, I think the disconnects might be caused by something else. Anyway...
Since last week or so, our HAProxy on Draco is failing to forward connections for a short while every night (CET night / very early morning, American evening / late night). The situation seems to last for about 10 minutes every time, and sometimes it happens 2 times in a row.
When this happens, some Uptime Robot monitors of mine (Wiki and Mastodon) are catching it:
And the ejabberd monitor script logs then confirm that it was indeed pretty much everything forwarded by HAProxy, not just Web properties. As it tries to reconnect every minute, here's what that looks like:
Eventually, the connections succeed again, and the script is able to re-join the other node into the cluster.
Next steps
For ejabberd, we simply don't have to (and shouldn't) route through the HAProxy for cluster connections in the first place: #310
For HAProxy, we need to investigate what's actually happening there, so we can mitigate it: #314
Investigate/fix ejabberd cluster node disconnectsto ejabberd cluster node disconnectsThe ejabberd cluster has been replaced by new nodes connecting to each other via the private network now. However, they reconnect every few minutes for some reason, but do so automatically. So there is no need for any custom scripts anymore at least.
I think we should keep an eye on this and see if we can find out why they don't stay connected more persistently.
Just witnessed this in the logs on
ejabberd-3:The last problem there was
ejabberd-3waiting forejabberd-5unsuccessfully to sync the mnesia tables. The PR I just ref'ed solved the issue.Finally closing this one for now, but will keep an eye on the situation for the next few days.