torodb / testing-tools

A set of projects that make it easy to execute test, specially with docker. It is heavily used by ToroDB, but can be useful on third party projects.
Apache License 2.0
1 stars 3 forks source link

RequiresReplicaSet and some other mongo annotations do not work on Mac (and maybe Windows) #7

Open gortiz opened 7 years ago

gortiz commented 7 years ago

Some Mongo docker services have been designed to be accessed through their per-container IP. That feature is not supported on Mac (see docker's page on the issue.

This is has been designed like that because a requirement on ToroDB Stampede, which requires to access the replication nodes directly and get the address from the replication set configuration, which means it requires that the used address on that configuration can be accessed from the host. But at the same time, mongod nodes require to be able to find themself on the replica set, so the same address must be accessible from the host but also from each container.

The recommended solution is to bind exposed ports, but to do that we would need to add a bridge between them and the host, set the addresses on the configuration to addresses on the bridge and modify each mongod configuration to recognize themself as the alias we use.

As it is not an easy task and the primary target of this project, at least right now, is to support Stampede on testing, the priority is very low.