Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- echo "======== Start initiating Replica Set ========"
- mongosh --host mongo1 <<EOF
- config = {
- _id: "rs0",
- members: [
- {
- _id: 0,
- host: "mongo1:27017",
- },
- {
- _id: 1,
- host: "mongo2:27017",
- },
- {
- _id: 2,
- host: "mongo3:27017",
- },
- ],
- };
- rs.initiate(config)
- rs.status()
- EOF
- echo "=============================================="
Advertisement
Add Comment
Please, Sign In to add comment