Re: Re: Error in Replicaset : No such host is Known

From: Rutula Sulakhe <rutula.sulakhe@xxxxxxxxxxxxxx>
To: mongodb-user@xxxxxxxxxxxxxxxx
Date: Tue, 10 May 2016 16:12:02 +0530
Why ads?
Hi Chris,

I have attached the rs.status json as well as code snippet of my app in the
mail, please do check.
The connection string in the config is : mongodb://user:pwd@gpx-bi-mdb-1
:12000,gpx-bi-mdb-2:12500,gpx-bi-mdb-3:13000/coupon
This connection is made between 2 Data Centers, i.e, The app is deployed in
one and server is in another.
The C# driver version that I am using is 1.10.1.73.
Also, I tried to ping the host, its is resolvable.

  Regards,
    Rutula Sulakhe.

On Tue, May 10, 2016 at 6:04 AM, Chris Cunningham <
chris.cunningham@xxxxxxxxxxx> wrote:

Rutula,


Thank you for sending the error log for review. In order to verify that
the primary is running and reachable, could you please post the output of

rs.status() for analysis?


Please review rs.status()
<https://docs.mongodb.com/manual/reference/method/rs.status/> for more
information on this command.


You may also find it helpful to review replica set troubleshooting steps
<https://docs.mongodb.com/manual/tutorial/troubleshoot-replica-sets/> to
help guide you on resolving common replica set issues.


It might also be useful to check the DNS. It might be a situation where
the service is unable to resolve the hostname.


Could you send us a snippet of code for your C# app that contains the
connection string and also the readPreference settings?


Can you please verify the MongoDB C# driver version ?


Regards,


Chris

--
You received this message because you are subscribed to the Google Groups
"mongodb-user"
group.

For other MongoDB technical support options, see:
https://docs.mongodb.org/manual/support/
---
You received this message because you are subscribed to a topic in the
Google Groups "mongodb-user" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/mongodb-user/TRMHAY66sEc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
mongodb-user+unsubscribe@xxxxxxxxxxxxxxxx.
To post to this group, send email to mongodb-user@xxxxxxxxxxxxxxxx.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit
https://groups.google.com/d/msgid/mongodb-user/c24bc41e-fb3e-4255-a051-3f2da6ae1572%40googlegroups.com
<https://groups.google.com/d/msgid/mongodb-user/c24bc41e-fb3e-4255-a051-3f2da6ae1572%40googlegroups.com?utm_medium=email&utm_source=footer>
.

For more options, visit https://groups.google.com/d/optout.




-- 
Regards,
Rutula Sulakhe.
Software Developer.

-- 
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.

For other MongoDB technical support options, see: https://docs.mongodb.org/manual/support/
--- 
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe@xxxxxxxxxxxxxxxx.
To post to this group, send email to mongodb-user@xxxxxxxxxxxxxxxx.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/CAKmfUmDpPiFgFc14p1aSvqFwFJfUSvdUYi4yGBOD8%3DDPoDQZuw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
         MongoClient objToclient, objFromclient;
         MongoServer objToserver, objFromserver;
         MongoDatabase objTodb, objFromdb;
         MongoCollection objFromCol;
                 
                 try
                 {
                                 
                        objFromclient = new MongoClient(clsAppSettings.Get("Host" + collection.Trim(), ""));
        
                        objFromserver = objFromclient.GetServer();
                        objFromdb = objFromserver.GetDatabase(clsAppSettings.Get("Db" + collection.Trim(), ""));
        
                        objFromCol = objFromdb.GetCollection(execCollection.Key.Trim());
        
                        var objSrchDoc = MongoDB.Bson.Serialization.BsonSerializer.Deserialize<BsonDocument>(str);
                                var objQryDoc = new QueryDocument(objSrchDoc);
                        
                                var objCurMain = objFromCol.FindAs<BsonDocument>(objQryDoc);
                                objCurMain.BatchSize = 1000;
                        
                                objToclient = new MongoClient(clsAppSettings.Get("HostDest" + collection.Trim(), ""));
                        
                                objToserver = objToclient.GetServer();
                                objTodb = objToserver.GetDatabase(clsAppSettings.Get("DestDb" + collection.Trim(), ""));
                        
                                var bulk = objTodb.
                                                GetCollection<BsonDocument>(execCollection.Key.Trim()).
                                                InitializeOrderedBulkOperation();
                        
                                if (objCurMain.Size() > 0)
                                {
                                        foreach (BsonDocument bd in objCurMain)
                                        {
                                                bulk.Find(Query.EQ("_id", bd["_id"])).Upsert().ReplaceOne(bd);
                                                ctr++;
                                                if (ctr == Convert.ToInt32(clsAppSettings.Get("BatchSize", "1000")))
                                                {
                                                        var bulkWrite = bulk.Execute(WriteConcern.Acknowledged);
                        
                                                }
                                        }
                                }
                 }
                 catch(Exception ex)
                 {
                         
                 }
Why ads?