I created an AWS Document DB in the same region as my EC2. When I try to connect to it using the command provided by AWS the terminal seems to get stuck.
The ec2 and Document DB are in the same region.
Document DB's security group allows 27017 access.
Both are in the same VPC.
I don't understand why it says connected but then doesn't allow me to enter commands
asds_asds
You can check your working process from here https://docs.aws.amazon.com/documentdb/latest/developerguide/connect-ec2.html to see if you missed something.
Related
I have created a user and added my IP to whitelist.
when trying to connect to a cluster through mongo shell, i am required to enter the following line: mongo "mongodb+srv://cluster0.****.mongodb.net/" --username --password
I have filled in credentials for username and password and replaced dbname with my database name(tried using non-existing one as well in case that was the problem). it connects to the shell, but then crashes with the following error:
Error while trying to show server startup warnings: user is not allowed to do action [getLog] on [admin.]
MongoDB Enterprise atlas-7cwf8s-shard-0:PRIMARY>
tried googling and youtubing the issue, but cannot find the match on how to fix it.
Many thanks
That message says that the shell is unable to show you server startup warnings. It's expected in Atlas environment.
Supposing that's your own cluster, then:
Check the user in Atlas > Database Access
Check the MongoDB Roles header in the table.
If it's not atlas Admin, you can't issue this command:
db.adminCommand({getLog:"startupWarnings"})
Or any admin command, which is issued or tested automatically in the connection, hence the error.
Edit MongoDB Roles to the highest privileges (atlas Admin)
But you can still work anyways.
If you're accessing someone else's cluster, then there isn't much to do.
I am trying to configure DocumentDB in AWS but it give me "Time out error".
i checked security group,VPC everything are same as my EC2 instance.
After i try to connect the mongo db with mongo shell
there also its give me "time out" error.
Check that the security group has an entry that allows traffic from itself on DocumentDB port.
getting "pymongo.errors.OperationFailure: not authorized on admin to execute command" on Atlas mongo db instance.
And while I run the same command on a local mongo DB instance, I don't get the error.
db.command("usersInfo")
This is expected in Atlas shared tier (M0/M2/M5). See:
Unsupported Commands in M0/M2/M5 Clusters
Unsupported Commands in M10+ Clusters
Regarding usersInfo:
This command can only be called with arguments:
{user: <MYUSER>, db: 'admin'}
Local MongoDB instances wouldn't have this restriction because it's entirely your responsibility to secure the deployment, and thus not subject to strict secure default settings like Atlas.
I can connect to a MongoDB Atlas replica set but it has no database.
When I click the master node, it shows a new shell
And I can find the objects with db.getCollection('aCollection').find()
How can I show/add the database in the left pane?
ps. I was using Robo3T 1.3.1
IMO this is a issue of insufficient privileges on the user account used to log in to ROBO3T and access MongoDB. You can follow this link. It points to a similar issue on Robo3Ts Github. You can use MongoDB Compass to connect to remote/Atlas MongoDB instances too. It is much user friendly.
This worked for me. Just set MongoDB Roles to atlasAdmin#admin.
Since last week I can not access my mongoDb collections on Compose.io using any mongo client. Client log says it is connected to DB but when I want to list collections or view document says "Collection not found!". I till can connect with terminal and do there whatever I need.
Initially I thought it is a problem with my MacOS machine, but then I tried to connect from other computers and using different clients ( Mongo-Express, MongoHub ) still no luck.
Wondering if I'm experiencing this problem alone or other compose.io clients also do ?
Tried to grant readWrite role to my mongo user as advised here (MongoDB - admin user not authorized), this does not help either.
Contacted compose.io support, but they swear that did change anything.
Any advise appreciated.
Thank you.
I was trying to connect to slave node which fails with { [MongoError: not master and slaveOk=false] name: 'MongoError' }
. Connecting with MongoClient to primary node solves the problem.