Skip to content

Commit

Permalink
use new mongosh
Browse files Browse the repository at this point in the history
  • Loading branch information
emanuelet committed Jan 25, 2024
1 parent df8be7e commit c4776b5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions .github/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function waitForMongo {
n=0
until [ $n -ge 20 ]
do
mongo admin --quiet --port $port --eval "db" && break
mongosh admin --quiet --port $port --eval "db" && break
n=$[$n+1]
sleep 2
done
Expand All @@ -38,18 +38,18 @@ waitForMongo 27003

echo "CONFIGURING REPLICA SET"
CONFIG="{ _id: '$REPLICA_SET_NAME', members: [{_id: 0, host: 'localhost:27001', priority: 2 }, { _id: 1, host: 'localhost:27002' }, { _id: 2, host: 'localhost:27003' } ]}"
mongo admin --port 27001 --eval "db.runCommand({ replSetInitiate: $CONFIG })"
mongosh admin --port 27001 --eval "db.runCommand({ replSetInitiate: $CONFIG })"

waitForMongo 27002
waitForMongo 27003

mongo admin --port 27001 --eval "db.runCommand({ setParameter: 1, quiet: 1 })"
mongo admin --port 27002 --eval "db.runCommand({ setParameter: 1, quiet: 1 })"
mongo admin --port 27003 --eval "db.runCommand({ setParameter: 1, quiet: 1 })"
mongosh admin --port 27001 --eval "db.runCommand({ setParameter: 1, quiet: 1 })"
mongosh admin --port 27002 --eval "db.runCommand({ setParameter: 1, quiet: 1 })"
mongosh admin --port 27003 --eval "db.runCommand({ setParameter: 1, quiet: 1 })"

mongo admin --port 27001 --eval "db.adminCommand({ setParameter: 1, maxTransactionLockRequestTimeoutMillis: 5000 })"
mongo admin --port 27002 --eval "db.adminCommand({ setParameter: 1, maxTransactionLockRequestTimeoutMillis: 5000 })"
mongo admin --port 27003 --eval "db.adminCommand({ setParameter: 1, maxTransactionLockRequestTimeoutMillis: 5000 })"
mongosh admin --port 27001 --eval "db.adminCommand({ setParameter: 1, maxTransactionLockRequestTimeoutMillis: 5000 })"
mongosh admin --port 27002 --eval "db.adminCommand({ setParameter: 1, maxTransactionLockRequestTimeoutMillis: 5000 })"
mongosh admin --port 27003 --eval "db.adminCommand({ setParameter: 1, maxTransactionLockRequestTimeoutMillis: 5000 })"

echo "REPLICA SET ONLINE"

Expand Down

0 comments on commit c4776b5

Please sign in to comment.