Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mongoexport remote database not connecting

I need to export some info from my MongoDB (hosted on MongoHQ // Compose.io) instance. I'm following these instructions, which give all the examples I need and seem to correspond with the official mongo docs. Here's the command i'm running:

mongoexport -h kahana.mongohq.com:12345/my_db_name -u username -p password -d my_db -c usercollection -f "firstName,lastName,macIdNum,iclass" --csv

and the output:

2014-09-17T21:58:12.806-0500 starting new replica set monitor for replica set kahana.mongohq.com:10043 with seeds my_db_name:27017
2014-09-17T21:58:12.806-0500 [ReplicaSetMonitorWatcher] starting
2014-09-17T21:58:12.919-0500 getaddrinfo("my_db_name") failed: nodename nor servname provided, or not known
2014-09-17T21:58:12.952-0500 warning: No primary detected for set kahana.mongohq.com:12345
2014-09-17T21:58:12.952-0500 All nodes for set kahana.mongohq.com:12345 are down. This has happened for 1 checks in a row. Polling will stop after 29 more failed checks
couldn't connect to [kahana.mongohq.com:12345/my_db_name] connect failed to replica set kahana.mongohq.com:12345/my_db_name:27017

Not really sure what the problem is here. Any help would be greatly appreciated!

like image 851
wkd Avatar asked Mar 18 '23 10:03

wkd


1 Answers

This should work:

mongoexport -h kahana.mongohq.com:12345 -u username -p password -d my_db -c usercollection -f "firstName,lastName,macIdNum,iclass" --csv

The '-h' hostname option is meant to specify only 'hostname/IP:port'.

like image 64
vmr Avatar answered Apr 01 '23 08:04

vmr