Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why scanning? #36

Closed
tcurdt opened this issue Jul 29, 2011 · 4 comments
Closed

why scanning? #36

tcurdt opened this issue Jul 29, 2011 · 4 comments

Comments

@tcurdt
Copy link

tcurdt commented Jul 29, 2011

Although mongolian gets passed in the connection information

var mongo = new Mongolian('localhost:27017');

it prints

mongo://localhost:27017: Connected
mongo://localhost:27017: Initialized as primary
mongo://localhost:27017: Connected to primary
Finished scanning... primary? mongo://localhost:27017

which suggests it's searching for mongo. Why the scanning?

@marcello3d
Copy link
Owner

The scanning process is to handle replica sets (
http://www.mongodb.org/display/DOCS/Replica+Sets).

Mongolian DB will connect to the specified mongo server(s), ask them if
they're a primary server (and potentially learn about new servers), and
finally settle on the primary server (if found).

In a single-server setup, this process is pretty simple and fast since there
is only one server and it's always the primary server. These messages are
most useful for debugging complex setups.

@tcurdt
Copy link
Author

tcurdt commented Jul 31, 2011

shouldn't the messages only be printed when debugging, then?

@marcello3d
Copy link
Owner

It's the default console logging. There's no standard node.js "debugging" mode that is appropriate here, so if you want to change the logging style, pass a custom logger into the constructor as described in the readme.

@tcurdt
Copy link
Author

tcurdt commented Aug 1, 2011

"debugging" in the sense of "I need that kind of information and for that reason set a custom logger".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants