4

I have a mongo db cluster hosted on AWS via atlas cloud offering. Problem: I have gotten myself into a situation where I have idle/stale connections connected to my cluster and I can't seem to get rid of them.

The connection count is 98 and my tier allows be to have just 100.

I do have ability to connect to this cluster via Mongo Shell or other tooling, but I can't seem to find a way to restart the service or to force close the connections.

Now I do not have access to the underlying container or VM so I can't control control the mongo service.

When I connect through the shell I tried

db.runCommand( { killAllSessions: [ ] } )

but that gave me

{ "ok" : 0, "errmsg" : "CMD_NOT_ALLOWED: killAllSessions", "code" : 8000, "codeName" : "AtlasError" }

The user I'm connecting with to the shell has the max permissions - it's atlasAdmin@admin role (I also tried with clusterMonitor@admin role)

I also can't seem to find any restart options in the mongo cloud manager web UI

1 Answer 1

17

This is what I ended up doing.

Since I was on M0 tier my only option was to remove all IP's from the IP Whitelist - that immediately closed all external connections to my cluster. Then I re-added the needed IPs back.

If I was on a higher tier I could have also tried this approach - https://docs.atlas.mongodb.com/tutorial/test-failover/

1
  • Works with M10 as well Commented Nov 2, 2021 at 7:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.