The difference is that you do not have a replica set on your own single computer (osx?) For laptop / desktop. his work offline. but have or intend to have a set of replicas on these three servers.
here are some potential problems with the provided string.
1) 27017 is the default port for mongo, so if it has not been specifically changed to 36108, this is not true.
mongodb:
try
mongodb:
2) w = 0 is unfamiliar to me, maybe this is the name of your replica set. usually the connection string for replica sets is as follows, where rs0 is the name of replicaSet.
mongodb:
3) it is possible that you do not have a customized set of replicas. check rs.config
log in to the server, mongo1.mysite.com
go to mongo shell using mongo admin -u clusteradmin -p whateverpassword
a type
rs.config ()
If you do not see anything like this, then you do not have a replica to connect to. here rs0 is the name of the replica set. your MAY be called w ???
{ "_id" : "rs0", "version" : 4, "members" : [ { "_id" : 0, "host" : "mongo1.mysite.com:36108" }, { "_id" : 1, "host" : "mongo2.mysite.com:36108" }, { "_id" : 2, "host" : "mongo3.mysite.com:36108", } ] }
- If this configuration is missing, you need to add your 3 hosts to the replica set configuration.
rs.add ("mongo1.mysite.com:36108") // or the default port with "mongo1.mysite.com:27017" rs.add ("mongo2.mysite.com:36108") rs.add ("mongo3 .mysite.com: 36108 ")
But better than anything, it's a replica set, including this doc for converting a standalone replica set
This line / db _config looks like the equivalent rs.config () command, but it does http and expects the server list to be added to the replica set. but honestly you can't connect to a replica set to configure it? so it seems strange. you can connect to the primary, so try
mongodb: