member.config = new MongodConfigBuilder().version(Versions.withFeatures(new GenericVersion(rsSettings.get("version"))))
.net(new de.flapdoodle.embed.mongo.config.Net(ports[i - 1], Network.localhostIsIPv6())).replication(storage).build();
logger.trace("replSetName in config: {}", member.config.replication().getReplSetName());
member.executable = type.starter.prepare(member.config);
member.process = member.executable.start();
member.address = new ServerAddress(Network.getLocalHost().getHostName(), member.config.net().getPort());
logger.debug("Server #" + i + ": {}", member.address);
builder.add(member);
}
ImmutableList<MongoReplicaSet.Member> members = builder.build();
Thread.sleep(2000);
MongoClientOptions mco = MongoClientOptions.builder().autoConnectRetry(true).connectTimeout(15000).socketTimeout(60000).build();
Mongo mongo = new MongoClient(new ServerAddress(Network.getLocalHost().getHostName(), ports[0]), mco);
DB mongoAdminDB = mongo.getDB(ADMIN_DATABASE_NAME);
cr = mongoAdminDB.command(new BasicDBObject("isMaster", 1));
logger.debug("isMaster: " + cr);