0

I manually installed MongoDb on EC2 micro instance using this http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/

Now I need to connect to it from a Rails application. Where do I find or set all these variables at my instance:

#mongoid.yml

production:
  host: 
  port: 
  username: 
  password: 
  database: 
1

As the installation instructions state the database by default listens only on the localhost interface. So you can connect only from the same host using 127.0.0.1 as host.

As stated in the Getting Started document, the default port is 27017 and the default database is test.

Also if you did not Enable Client Access Control no username and password is required.

  • Also if you did not Enable Client Access Control no username and password is required. - so I can get it to work on EC2 without a user name and a password knowing a host (127.0.0.1) and port (27017) ? – アレックス Sep 14 '14 at 16:43
  • yes but you have to run your application that will connect to mongoDB in the same EC2 instance that mongoDB runs. – atrias Sep 14 '14 at 18:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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