Csharp driver does not have a replica set name

526 views
Skip to first unread message

kuku

unread,
Oct 9, 2011, 4:51:18 AM10/9/11
to mongodb-csharp, mongodb...@googlegroups.com
Csharp driver Unable to connect to the primary member of the replica
set: Server at address '61.55.187.14:40000' does not have a replica
set name

mongod://61.55.187.14:40000,61.55.187.15:40000,61.55.187.16:40000

Robert Stam

unread,
Oct 9, 2011, 6:44:02 AM10/9/11
to mongodb-csharp
A connection string with more than one host address implies that you
are connecting to a replica set. The error message indicates that the
servers don't seem to be part of a replica set.

Can you connect to each server one at a time with the mongo shell and
type:

> db.isMaster()

and report back what the output looks like?

kuku

unread,
Oct 9, 2011, 6:53:14 AM10/9/11
to mongodb-csharp
Only CSharp Driver has a problem, python, and Java is no problem,
connection string don't what parameters!!!! Generation environment to
(master,slave no problem)For help!

Robert Stam

unread,
Oct 11, 2011, 10:45:59 AM10/11/11
to mongodb-csharp
Not sure why you are not getting an error message when using other
language drivers.

The C# driver error message indicates that the server at
61.55.187.14:40000 is not a member of a replica set. Can you execute
the following mongo shell command to verify whether that server is a
member of a replica set or not?

C:\mongodb\mongodb-win32-x86_64-2.0.0\bin>mongo --host localhost --
port 27017
MongoDB shell version: 2.0.0
connecting to: localhost:27017/test
> db.isMaster()
{ "ismaster" : true, "maxBsonObjectSize" : 16777216, "ok" : 1 }
>

In the above commands replace "localhost" with "61.55.187.14" and
"27017" with "40000".

The output above is for a server that is NOT a member of a replica
set. Please post your output for comparison.

AlexChan

unread,
Oct 25, 2011, 2:51:48 AM10/25/11
to mongodb-csharp
had you resoled this problem?
when i use master/slave mongodb,the official c# driver,i got this
problem also
how to set the connections string to use master/slave mongodb?

Robert Stam

unread,
Oct 25, 2011, 12:39:15 PM10/25/11
to mongodb-csharp
Master/Slave is deprecated, so you should be using replica sets.
Perhaps that's what you meant.

The connection string would look like:

mongodb://server1,server2/?safe=true

If server1 and server2 are not members of a replica set you will get
an error message.

If you are having a specific problem please post more details,
including the results of calling db.isMaster() on each of your servers
using the instructions above.
Reply all
Reply to author
Forward
0 new messages