title: com.mongodb.MongoTimeoutException when using MongoClient with list ServerAddress
body: <p>I'm trying to deploy a replica database onto one server with different port and connect with it.
  Everything is ok if I just use single ServerAddress and connect directly to Primary DB
  like this:</p>
  
  <pre><code>mongoClient =new MongoClient(new ServerAddress("104.236.106.53", 27000));
  morphia = new Morphia();
  ds = morphia.createDatastore(mongoClient, "morphiaDB");
  </code></pre>
  
  <p>Everything work fine. But when I'm trying to use <code>List&lt;ServerAddress&gt;</code> like this:</p>
  
  <pre><code>List&lt;ServerAddress&gt; lstServer = new ArrayList&lt;ServerAddress&gt;();
  lstServer.add(new ServerAddress("104.236.106.53", 27000));
  lstServer.add(new ServerAddress("104.236.106.53", 27002));
  lstServer.add(new ServerAddress("104.236.106.53", 27001));
  mongoClient = new MongoClient(lstServer);
  morphia = new Morphia();
  ds = morphia.createDatastore(mongoClient, "morphiaDB");
  </code></pre>
  
  <p>It will end up with this error:</p>
  
  <pre><code>SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
  SLF4J: Defaulting to no-operation (NOP) logger implementation
  SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
  Exception in thread "main" com.mongodb.MongoTimeoutException: Timed out after 10000 ms while waiting for a server that matches {serverSelectors=[ReadPreferenceServerSelector{readPreference=primary}, LatencyMinimizingServerSelector{acceptableLatencyDifference=15 ms}]}. Client view of cluster state is {type=ReplicaSet, servers=[{address=G-Server-1:27000, type=Unknown, state=Connecting, exception={com.mongodb.MongoException$Network: Exception opening the socket}, caused by {java.net.UnknownHostException: G-Server-1}}, {address=G-Server-1:27001, type=Unknown, state=Connecting, exception={com.mongodb.MongoException$Network: Exception opening the socket}, caused by {java.net.UnknownHostException: G-Server-1}}, {address=G-Server-1:27002, type=Unknown, state=Connecting, exception={com.mongodb.MongoException$Network: Exception opening the socket}, caused by {java.net.UnknownHostException: G-Server-1}}]
  at com.mongodb.BaseCluster.getServer(BaseCluster.java:82)
  at com.mongodb.DBTCPConnector.getServer(DBTCPConnector.java:654)
  at com.mongodb.DBTCPConnector.access$300(DBTCPConnector.java:39)
  at com.mongodb.DBTCPConnector$MyPort.getConnection(DBTCPConnector.java:503)
  at com.mongodb.DBTCPConnector$MyPort.get(DBTCPConnector.java:451)
  at com.mongodb.DBTCPConnector.getPrimaryPort(DBTCPConnector.java:409)
  at com.mongodb.DBCollectionImpl.insert(DBCollectionImpl.java:182)
  at com.mongodb.DBCollectionImpl.insert(DBCollectionImpl.java:165)
  at com.mongodb.DBCollection.insert(DBCollection.java:161)
  at com.mongodb.DBCollection.insert(DBCollection.java:107)
  at com.mongodb.DBCollection.save(DBCollection.java:965)
  at org.mongodb.morphia.DatastoreImpl.save(DatastoreImpl.java:949)
  at org.mongodb.morphia.DatastoreImpl.save(DatastoreImpl.java:1013)
  at org.mongodb.morphia.DatastoreImpl.save(DatastoreImpl.java:1000)
  at com.learn.DAO.AuthorBookDAO.main(AuthorBookDAO.java:18)
  </code></pre>
  
  <p>Can anybody tell me what this error is or provide me some hint how to solve it?</p>