The problem with the "Meteor mongo" command when connecting to a separate Mongo Instance

When running the "parties" example locally, if I first specify my MONGO_URL to use an already existing instance of mongo meteor mongo , which reports that the meteorite does not work, although it is, and although it connects just fine to a separate instance of mongo.

If you run the meteor application without specifying a separate MONGO_URL, no problems meteor mongo works as expected

Now I also tried setting MONGO_URL before running meteor mongo no avail. I have not tried deploying the application to find out what will happen.

Another troubleshooting attempt - after starting the application, I try to connect using meteor mongo with the flag --url localhost:27017 , which asks for Password:. This should give me the url to connect to the database instance, and the password request is also not mongo, as

a) I do not have authentication in my local instance

b) Even if the local instance is not running and you run meteor mongo , it still asks for a password.

In meteor documentation, this is noted under meteor mongo:

You should now have an application running locally with meteorite runs. It will be easier> in the future.

Is that what they mean?

Obviously, it has nothing to do with the fact that I have access to the shell from the meteor object to my local instance, since I can always access the shell just by typing mongo, but my deployment problem is, and I have to get access to the shell, then, this can be a problem.

+1
source share
1 answer

Meteor mongo is designed to connect to mongo weather stations when it is launched during development, that is, it works with meteor run , without MONGO_URL or in deployment mode on meteor.com

This means that it cannot access other mongodbs, for example, if you specify MONGO_URL . meteor mongo is really looking for the id of the current mongodb process working in the .meteor directory of your project.

The reason meteor mongo --url localhost:27017 asks for a password is an attempt to connect to the meteor.com hosting (if you deployed the application through the deployment of meteors), so if you deployed your application for test.meteor.com, you can access it mongodb uri via meteor mongo test.meteor.com . If a password is set, it will ask for that password.

To access the local mongodb collection, you will need to look at the /bin your mongodb instance or use mongo --dbpath xxx , where xxx is where your database is installed. (Or, as you mentioned, use mongo )

+4
source

Source: https://habr.com/ru/post/950374/


All Articles