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

mongo 3.x replicaset init failed #554

Closed
achevalet opened this issue Sep 3, 2019 · 2 comments · Fixed by #556
Closed

mongo 3.x replicaset init failed #554

achevalet opened this issue Sep 3, 2019 · 2 comments · Fixed by #556

Comments

@achevalet
Copy link

achevalet commented Sep 3, 2019

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 4.10.12
  • Ruby: 2.0.0p648 (2015-12-16) [x86_64-linux]
  • Distribution: CentOS Linux release 7.6.1810
  • Module version: 3.0.0

How to reproduce (e.g Puppet code you use)

mongodb_replset { rsmain:
  ensure  => present,
  members => ['host1:27017', 'host2:27017', 'host3:27017']
}

What are you seeing

Error: /Stage[main]/Mongodb::Replset/Mongodb_replset[rsmain]: Could not evaluate: rs.initiate() failed for replicaset rsmain: Found two member configurations with same _id field, members.0._id == members.1._id == 1

What behaviour did you expect instead

Notice: /Stage[main]/Mongodb::Replset/Mongodb_replset[rsmain]/ensure: created

Output log


Debug: Executing: '/bin/mongo admin --quiet --host 127.0.0.1:27017 --eval printjson(rs.conf())'
Debug: Got an exception: Could not evaluate MongoDB shell command: printjson(rs.conf())
Notice: /Stage[main]/Mongodb::Replset/Mongodb_replset[rsmain]/ensure: created
Debug: Checking for dead and alive members
Debug: Checking replicaset member host1:27017 ...
Debug: Executing: '/bin/mongo admin --quiet --host host1:27017 --eval printjson(rs.status())'
Debug: Mongo v4 rs.status() RS not initialized output
Debug: Host host1:27017 is alive but unconfigured: run rs.... if not yet done for the set
Debug: Checking replicaset member host2:27017 ...
Debug: Executing: '/bin/mongo admin --quiet --host host2:27017 --eval printjson(rs.status())'
Debug: Mongo v4 rs.status() RS not initialized output
Debug: Host host2:27017 is alive but unconfigured: run rs.... if not yet done for the set
Debug: Checking replicaset member host3:27017 ...
Debug: Executing: '/bin/mongo admin --quiet --host host3:27017 --eval printjson(rs.status())'
Debug: Mongo v4 rs.status() RS not initialized output
Debug: Host host3:27017 is alive but unconfigured: run rs.... if not yet done for the set
Debug: Alive members: [{"host"=>"host1:27017"}, {"host"=>"host1:27017"}, {"host"=>"host2:27017"}, {"host"=>"host2:27017"}, {"host"=>"host3:27017"}, {"host"=>"host3:27017"}]
Debug: Checking for new replset
Debug: Executing: '/bin/mongo admin --quiet --host host1:27017 --eval printjson(db.isMaster())'
Debug: Executing: '/bin/mongo admin --quiet --host host1:27017 --eval printjson(db.isMaster())'
Debug: Executing: '/bin/mongo admin --quiet --host host2:27017 --eval printjson(db.isMaster())'
Debug: Executing: '/bin/mongo admin --quiet --host host2:27017 --eval printjson(db.isMaster())'
Debug: Executing: '/bin/mongo admin --quiet --host host3:27017 --eval printjson(db.isMaster())'
Debug: Executing: '/bin/mongo admin --quiet --host host3:27017 --eval printjson(db.isMaster())'
Debug: Initializing the replset rsmain
Debug: Starting replset config is "{\"_id\":\"rsmain\",\"members\":[{\"host\":\"host1:27017\",\"_id\":1},{\"host\":\"host1:27017\",\"_id\":1},{\"host\":\"host2:27017\",\"_id\":3},{\"host\":\"host2:27017\",\"_id\":3},{\"host\":\"host3:27017\",\"_id\":5},{\"host\":\"host3:27017\",\"_id\":5}],\"settings\":{}}"

Any additional information you'd like to impart

members are pushed two times since v4 support has been added: #535

@markkerssens
Copy link

You might want to check this fix: #553

@achevalet
Copy link
Author

Thanks @markkerssens !

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

Successfully merging a pull request may close this issue.

2 participants