Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mlaunch testing for MongoDB 3.6 #531

Closed
stennie opened this issue Oct 15, 2017 · 1 comment
Closed

mlaunch testing for MongoDB 3.6 #531

stennie opened this issue Oct 15, 2017 · 1 comment
Milestone

Comments

@stennie
Copy link
Collaborator

stennie commented Oct 15, 2017

MongoDB 3.6.0-rc0 is out so it would be good to test if there are any obvious changes that mlaunch should handle.

Draft release notes: https://docs.mongodb.com/master/release-notes/3.6/

@stephentunney
Copy link

stephentunney commented Nov 21, 2017

I worked on this last week. Essentially, the only issue that arose from using the 3.6 binaries with mlaunch was that if you pass in a hostname when starting a replica set or a sharded cluster, you will get an error when they attempt to start talking with each other as a result of MongoDB binaries binding to local host by default. As a result of this change, connections from other nodes will be refused by a mongod or a mongos only when a non localhost hostname is used.

Replica Set
mlaunch.py --replica set --name repl1 --nodes 3 --hostname Stephens-MacBook-Pro.local

launching: mongod on port 27017
launching: mongod on port 27018
launching: mongod on port 27019
replSetInitiate quorum check failed because not all proposed set members responded affirmatively: Stephens-MacBook-Pro.local:27018 failed with Connection refused, Stephens-MacBook-Pro.local:27019 failed with Connection refused - will retry

Sharded Cluster

launching: mongod on port 27018
launching: mongod on port 27019
launching: mongod on port 27020
launching: mongod on port 27021
launching: mongod on port 27022
launching: mongod on port 27023
launching: mongod on port 27024
launching: mongod on port 27025
launching: mongod on port 27026
launching: config server on port 27027

replica set 'configRepl' initialized.

replSetInitiate quorum check failed because not all proposed set members responded affirmatively: Stephens-MacBook-Pro.local:27019 failed with Connection refused, Stephens-MacBook-Pro.local:27020 failed with Connection refused - will retry

The Fix
The way to address this is by passing in either a valid bind_ip list or by specifying bind_ip_all options at runtime. Initially, I was going to propose passing in bind_ip_all anytime a hostname is used but this is a direct contradiction to what the localhost binding feature of 3.6 is all about. Instead I created a series of checks in the def _construct_mongod function that will:

  1. Check if a non-localhost name is being passed
  2. Check that the binary version is 3.6 or above
  3. Check that the replica set or sharded cluster options are being used
  4. Check if no bind_ip options have been passed

If these conditions are met, then it will raise a system exit and throw an error message:

If hostname is specified, please include '--bind_ip_all' or '--bind_ip' options when deploying replica sets or sharded cluster with MongoDB version 3.6.0 or greater

It will also clear the data path of any mongod/mongos instances that were spun up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants