0

Im trying to import a mongo collection onto an EC2 instance, i have used

mongoimport -d test -c foo importfile.json

This worked fine on my localhost but on my EC2 instance it says

mongoimport -d test_mr -c att_live /var/www/html/app/config/schema/reduced.json couldn't connect to [127.0.0.1] couldn't connect to server 127.0.0.1

I have no problems connecting to my mongodb on the EC2 server and doing commands manually, it just fails on the import.

Any suggestions?

1
  • Have you checked your mongo db is running on the default port expected by the import script? If it isn't you will need to specify --port <port>
    – Ray Vahey
    Oct 12, 2011 at 6:19

1 Answer 1

0

Sorted it....

mongod wasnt running as a daemon, so i could connect to mongo from shell and do querys, but when i exited or ctrl+C'd it closed the entire host process, so when i ran mongoimport theres was nothing to connect to

1
  • Adding the --fork flag to your mongod invocation will take care of that...
    – gWaldo
    Nov 3, 2011 at 19:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .