Last active
May 1, 2020 12:40
-
-
Save katopz/4c3662be9054ad1e846fd7c9dc319966 to your computer and use it in GitHub Desktop.
Basic setup for 2 replica set. will need rs.sh at https://gist.github.com/katopz/da912b3fa2677b5f149fd01e5243e28a
This file contains hidden or 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
# List existing mongo process | |
pgrep mongo | |
# Kill existing process if has. | |
pkill mongo | |
# Clear old folder if has. | |
rm -rf rs0 && rm -rf rs1 | |
# Create log folder. | |
mkdir -p ./var/log/mongodb | |
# Create replica set 0 | |
. rs.sh 0 | |
# Create replica set 1 | |
. rs.sh 1 | |
# List existing mongo process | |
pgrep mongo | |
# Connect to available host | |
mongo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment