We’re just testing out using MongoDB in Kubernetes as a replacement for our existing platforms. Really at the moment we’re just doing throughput testing - we’re currently using AWS DocumentDB which seems prone to random slowdowns and is generally not particularly stable.
Percona seems to be a great solution. We’ve deployed the app using the EKS quickstart, and all seems to be fine. We’ve exposed the database via a Load Balancer and can connect remotely via the userAdmin account that’s created by default.
However, I’m having a problem that I’m really struggling to diagnose - whenever I create a new user within Mongo, I can connect to the DB from a local tty session, but that same user can’t connect remotely. I’m really struggling to diagnose this, as the userAdmin user can log in with no problems. Here’s the db.createUser command I’m using:
db.createUser({
user: "george",
pwd: "mypassword",
roles: [
{db: "admin", role: "userAdminAnyDatabase"},
]
})
When connecting via a remote pymongo session, I get the following error:
OperationFailure: Authentication failed., full error: {'operationTime': Timestamp(1643624885, 1), 'ok': 0.0, 'errmsg': 'Authentication failed.', 'code': 18, 'codeName': 'AuthenticationFailed', '$gleStats': {'lastOpTime': Timestamp(0, 0), 'electionId': ObjectId('7fffffff0000000000000003')}, 'lastCommittedOpTime': Timestamp(1643624885, 1), '$configServerState': {'opTime': {'ts': Timestamp(1643624885, 1), 't': 3}}, '$clusterTime': {'clusterTime': Timestamp(1643624885, 1), 'signature': {'hash': b'\'\xab\xf9\xf4"\xe0\xa8\xfe\xfd\x9d\x9e\xeeb\xb4\xfe{\xec\xbcV\xc9', 'keyId': 7059142238353227778}}}
I’m really struggling to diagnose this. I’m not sure if it’s an issue with the setup of the server, a Mongo issue, or potentially something I’ve just overlooked.