Mongodump is giving me eror

I am trying to back up a mongo db which is hosted on a seperate standalone server and I am trying to access from another server which has connection or talks to that mongodb however when I execute a cronjob to do dump its giving me the error as shown below:
mongodump-error-failed-cant-create-session-could-not-connect-to-server connection() error occurred during connection handshake: dial tcp mongoserverip:27017: i/o timeout

Where I m using the mongodump --uri mongodb://username:pswd:27017/mydb --archive= ‘path to store the dump’ --gzip

It works well with my local db on a local server though.Can someone help me with this error?

Hi @reno_sen and welcome to the community!
you need to specify the destination host, from the documentation :

Regards

1 Like