final List<ServerAddress> replicaServers = new ArrayList<>(mongoReplicaSet.size());
for (String host : mongoReplicaSet) {
try {
final HostAndPort hostAndPort = HostAndPort.fromString(host)
.withDefaultPort(27017);
replicaServers.add(new ServerAddress(
InetAddress.getByName(hostAndPort.getHostText()), hostAndPort.getPort()));
} catch (IllegalArgumentException e) {
LOG.error("Malformed mongodb_replica_set configuration.", e);
return null;
} catch (UnknownHostException e) {