Created
December 23, 2019 05:52
-
-
Save dyllanwli/c0050a72619a3c72882cbcf559df98a7 to your computer and use it in GitHub Desktop.
Mongodb set replica set
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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