Skip to content

Instantly share code, notes, and snippets.

@sarjarapu
Created May 16, 2018 14:30
Show Gist options
  • Save sarjarapu/ffe019411f2b77cb5b35f35d0d819bea to your computer and use it in GitHub Desktop.
Save sarjarapu/ffe019411f2b77cb5b35f35d0d819bea to your computer and use it in GitHub Desktop.
A bash script to setup a MongoDB environment with authentication on your local machine
# Don't have mtools? The easiest way to install mtools is via pip
# pip install mtools
mlaunch init --auth --replicaset --port 28000
# output
# launching: "mongod" on port 28000
# launching: "mongod" on port 28001
# launching: "mongod" on port 28002
# replica set 'replset' initialized.
# waiting for primary to add a user.
# Username "user", password "password"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment