Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

migrated from stackoverflow.com Oct 17 '11 at 7:18

This question came from our site for professional and enthusiast programmers.

    
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 '11 at 6:19

1 Answer 1

up vote 0 down vote accepted

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

share|improve this answer
    
Adding the --fork flag to your mongod invocation will take care of that... –  gWaldo Nov 3 '11 at 19:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.