Skip to content

Instantly share code, notes, and snippets.

@marcesher
Last active December 22, 2015 15:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcesher/6495312 to your computer and use it in GitHub Desktop.
Save marcesher/6495312 to your computer and use it in GitHub Desktop.
quickie: change mongo ports in repl set config
use local
cfg = db.system.replset.findOne()
cfg.members.forEach( function(m) { var tmp = m.host.replace(27018,12345); print(tmp); m.host = tmp; } )
cfg
db.system.replset.update({"_id":cfg['_id']}, cfg)
db.system.replset.findOne()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment