Closed p-mongo closed 2 years ago
Use of incorrect mongod causes mlaunch to fail when starting sharded clusters. This condition is responsible for setting csrs for 3.6+ servers:
# add the 'csrs' parameter as default for MongoDB >= 3.3.0
if (LooseVersion(self.current_version) >= LooseVersion("3.3.0") or
LooseVersion(self.current_version) == LooseVersion("0.0.0")):
self.args['csrs'] = True
Since self.current_version is erroneously set to 0.0, the csrs flag isn't set, and subsequently the following condition:
# CSRS config servers (MongoDB >=3.1.0)
if self.args['csrs']:
config_string.append(self._construct_config(self.dir, nextport,
"configRepl", True))
else:
for name in config_names:
self._construct_config(self.dir, nextport, name)
config_string.append('%s:%i' % (self.args['hostname'],
nextport))
nextport += 1
... goes into else branch instead of if and produces a broken configdb parameter (host names only without the replica set name).
The else branch doesn't look right also because the value of _construct_config isn't used anywhere.
Workaround for sharded clusters on 3.6+: https://github.com/p-mongodb/mtools-legacy/commit/90b1bc19aed3729d13409193f829a0516e62a7c9
When I use
--binarypath
option, the binary I am specifying is not used by mlaunch for server version detection and it tries to obtain the version (only) from globalmongod
.I don't know how to get this sort of output out of unmodified mlaunch, I added this patch:
This prints the detected version when launching mongod.
On my system there isn't a
mongod
inPATH
.Expected behavior
The binary I referenced used for version detection.
Actual/current behavior
The global
mongod
is used, which doesn't exist on my system, version ends up being set to 0.0 which I think is a separate problem - this would cause mlaunch to assume behavior (e.g. with respect to tls/ssl options) that may be incorrect.Steps to reproduce the actual/current behavior
Run patched mlaunch printing detected version.
Environment