From a job Kubernetes pod I am trying to connect to a Amazon DocumentDb server with following command. We are sending this command to the Kubenetes job pod using python program to list collections from the db.
This is the command we are passing
mongo --ssl --host host.us-west-2.docdb.amazonaws.com --port 27017 --sslCAFile global-bund
le.pem --username dbadmin --password ******** --authenticationDatabase doc_document_db --eval "db.getCollectionNames()"
I also tried this
mongo --ssl --host host.us-west-2.docdb.amazonaws.com:27017 --sslCAFile global-bund
le.pem --username dbadmin --password ******** --authenticationDatabase doc_document_db --eval "db.getCollectionNames()"
Though we are mentioning the database name as "-authenticationDatabase doc_document_db" but it is connecting to some "test" database by default. Anyone please help me to understand why it is being connected to some other database by default even after mentioning the required one?
2
Answers
This one worked for me finally
Please try this: