There are two network cards on my mongodb machine. I hope that the database read-write access will go through network card 1, the heartbeat between mongodb copies and synchronous data will go through network card 2, so that the two flows are separated. How should this be configured? Does anyone know?
There is no official solution for the time being, you can look at the issue of mongodb.SERVER-1889.
However, you can try one of the solutions mentioned in this issue, that is, to set hosts for replica-set and force other server addresses of replica-set to be resolved to a different network card ip. This requires all replica-set settings to use the domain name (FQDN) instead of specific IP, and to use the domain name when accessing mongodb.