top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Does mongo c driver has the function of auto re-connection?

+2 votes
194 views

I use the mongo c driver to operate the mongodb, I just wonder if the driver has the function of auto re-connection? And if I use a mongodb cluster with three shards, how can I connect all of the Mongos? And how can I do to switch to another mongos when i am using one of the mongos to operate the DB?

Any help is welcome.

posted Apr 21, 2016 by anonymous

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

Similar Questions
+2 votes

Considering working with a shard replica-set cluster, some emergency such as re-pick primary node will happen and maybe we can retry the command several times for waiting for recover of mongo.

Is there anyone know when use c driver api such as mongoc_collection_update, mongoc_collection_commond, mongoc_collection_insert, which error codes tell me that I can retry command for making the application more robust.

0 votes

Can you please update if Mongo-Hadoop connector has the support to take aggregation query output as the input to MapReduce jobs. I know there is support for find query through mongo.input.query configuration.

0 votes

I am trying to figuring out how to use $sample through the driver.
I know that there is the functionality, I just failed to comprehend how to use it...

+1 vote

With the non-blocking asynchronous mongo java/scala driver, it is possible to define a wait time and a wait queue size for operations that cannot be executed directly with a free connection. When settings these values, the mongo driver will make the threads waiting for an available connection.

This behavior is very dangerous for an application written with non-blocking asynchronous IO in mind. These applications use a very limited number of threads (= numbers of cores). Blocking one of these thread can block the whole application.

What would be the recommended way to for this kind of applications? Should we set all these waiting settings to 0 and handle MongoWaitQueueFullException with retries in the application? Should the driver call an application callback when a connection is free?

0 votes

How could we use encrypted password in connection string? Let suppose if we are using below string:mongo localhost:27017/admin -u abc -p Test123

But we don't want the password to be publically visible directly in connection string.

Is there any way to use encrypted password?

...