Skip to content

Instantly share code, notes, and snippets.

@dyllanwli
Created December 23, 2019 05:52
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 dyllanwli/c0050a72619a3c72882cbcf559df98a7 to your computer and use it in GitHub Desktop.
Save dyllanwli/c0050a72619a3c72882cbcf559df98a7 to your computer and use it in GitHub Desktop.
Mongodb set replica set
# start mongodb with --replSet rs
# the rs means replica set name
# if MONGO_INITDB_ROOT_USERNAME was set, then use those init db root username and password
mongo -u <your user name> --authenticationDatabase admin -p <your passowrd>
rs.initiate()
rs.status()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment