title: PyMongo MongoClient replica set won't connect
body: <p>A bit of background: I used Bitnami to spin up a 3 node Mongo cluster on Azure (1 arbiter), each mongod hosted on separate VMs. I've confirmed that the replica set exists, and that each node is able to connect to one another. I've confirmed that when I take down my primary node, the secondary node steps up.  When the primary node returns, it assumes the primary position again.</p>
  
  <p>My problem is that I can't connect to my MongoDB replica set using MongoClient when specifying replicaset. I would get this error:</p>
  
  <blockquote>
    <p>pymongo.errors.ServerSelectionTimeoutError: ArbiterIP:27017: [WinError
    10061] No connection could be made because the target machine actively
    refused it,PrimaryIP:27017: [WinError 10061] No connection could be
    made because the target machine actively refused it,SecondaryIP:27017:
    timed out</p>
  </blockquote>
  
  <p>Using MongoClient, if I do:</p>
  
  <p><code>connection = MongoClient('MyIP1:27017', w=2)</code> </p>
  
  <p>, it connects fine.  When I do</p>
  
  <pre><code>connection = MongoClient('MyIP1:27017', w=2, replicaset="repsetname")
  </code></pre>
  
  <p>, that's when I get the error. </p>
  
  <p>Would it be related to the fact that the arbiter node has no user info for authentication?</p>