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

Cannot config replica sets because connection test fails #277

Open
mehagar opened this issue Mar 20, 2021 · 0 comments
Open

Cannot config replica sets because connection test fails #277

mehagar opened this issue Mar 20, 2021 · 0 comments

Comments

@mehagar
Copy link

mehagar commented Mar 20, 2021

👻 Brief Description

When running the sc-mongodb::replicaset recipe on the last member of the replica set, the connection test fails before the recipe can even initialize the replica set. I need to manually go to the server and run rs.initiate() in the mongo shell in order for the connection test to succeed on subsequent chef runs. Before I run rs.initiate(), when trying to run the command db.adminCommand( { listDatabases: 1 } ) (which is what configure_replicaset does before initializing the replica set), I get a NotMasterOrSecondary error since the replica set has not been initialized.

It seems like the connection test before initializing the replica set should not be making a command that itself requires the replica set to already be initialized.

🥞 Cookbook version

3.0.0

👩‍🍳 Chef-Infra Version

14.15.6

🎩 Platform details

Ubuntu 18.04.5 LTS (GNU/Linux 5.4.0-1038-aws x86_64) running on AWS EC2

Steps To Reproduce

Steps to reproduce the behavior:

  1. Configure 3 servers, run the sc-mongodb::replicaset recipe on 2 of them with auto_configure set to false. Then run sc-mongondb::replicaset on the last one.

🚓 Expected behavior

The recipe automatically configures the replica set without any needed intervention.

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

No branches or pull requests

1 participant