Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

BC-6654 - Update mongo to v5 #70

Merged
merged 17 commits into from
Apr 17, 2024
24 changes: 11 additions & 13 deletions compose-files/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ services:

### Schul-Cloud Server
###
mongodb:
image: mongo:4.2.9 ## change tag in version.env
mongodb-primary:
image: mongo:5.0.26 ## change tag in version.env
container_name: mongodb-primary
ports:
- "27017:27017"
Expand All @@ -31,34 +31,34 @@ services:
- mongodb-secondary
- mongodb-arbiter
restart: unless-stopped
command: --bind_ip_all --replSet rs0 --enableMajorityReadConcern false
command: --bind_ip_all --replSet rs0

mongodb-secondary:
image: mongo:4.2.9 ## change tag in version.env
image: mongo:5.0.26 ## change tag in version.env
container_name: mongodb-secondary
ports:
- "27017"
- "27018:27017"
volumes:
- data-mongodb-secondary:/data/db
restart: unless-stopped
command: --bind_ip_all --replSet rs0 --enableMajorityReadConcern false
command: --bind_ip_all --replSet rs0

mongodb-arbiter:
image: mongo:4.2.9 ## change tag in version.env
image: mongo:5.0.26 ## change tag in version.env
container_name: mongodb-arbiter
ports:
- "27017"
- "27019:27017"
volumes:
- data-mongodb-arbiter:/data/db
restart: unless-stopped
command: --bind_ip_all --replSet rs0 --enableMajorityReadConcern false
command: --bind_ip_all --replSet rs0

mongosetup:
image: mongo:4.2.9
image: mongo:5.0.26
depends_on:
- mongodb
- mongodb-primary
- mongodb-secondary
- mongodb-arbiter
volumes:
Expand Down Expand Up @@ -146,8 +146,7 @@ services:
- CLAMAV__SERVICE_HOSTNAME=localhost
- CLAMAV__SERVICE_PORT=3310
# URIs and Port
- DB_URL=mongodb://mongodb:27017,mongodb-secondary:27017,mongodb-arbiter:27017/schulcloud?replicaSet=rs0&tls=false&readPreference=secondary
- DATABASE__URL=mongodb://server-mongodb:27017/schulcloud
- DB_URL=mongodb://mongodb-primary:27017,mongodb-secondary:27017,mongodb-arbiter:27017/schulcloud?replicaSet=rs0&tls=false
- REDIS_URI=redis://redis:6379
- RABBITMQ_URI=amqp://guest:guest@rabbit:5672
- CONTENT_URI=https://consent.schul-cloud.org #lernstore
Expand Down Expand Up @@ -207,8 +206,7 @@ services:
- FILES_STORAGE__S3_BUCKET=schulcloud
- FILES_STORAGE__S3_REGION=eu-central-1
# URIs and Port
- DB_URL=mongodb://mongodb:27017,mongodb-secondary:27017,mongodb-arbiter:27017/schulcloud?replicaSet=rs0&tls=false&readPreference=secondary
- DATABASE__URL=mongodb://server-mongodb:27017/schulcloud
- DB_URL=mongodb://mongodb-primary:27017,mongodb-secondary:27017,mongodb-arbiter:27017/schulcloud?replicaSet=rs0&tls=false
- REDIS_URI=redis://redis:6379
- RABBITMQ_URI=amqp://guest:guest@rabbit:5672
- CONTENT_URI=https://consent.schul-cloud.org #lernstore
Expand Down
2 changes: 1 addition & 1 deletion envs/default.env
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
COMPOSE_FILES_PATH=./compose-files
POSTGRES_DOCKER_TAG=11.9
REDIS_DOCKER_TAG=6.0.8
MONGO_DOCKER_TAG=4.2.9
MONGO_DOCKER_TAG=5.0.26
RABBITMQ_DOCKER_TAG=3.8.9-management
6 changes: 3 additions & 3 deletions scripts/mongo_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
sleep 10

echo SETUP.sh time now: `date +"%T" `
mongo --host mongodb:27017 --eval 'rs.initiate({_id: "rs0", members: [{_id: 0, host: "mongodb:27017" }]})'
mongo --host mongodb:27017 << EOF
mongo --host mongodb-primary:27017 --eval 'rs.initiate({_id: "rs0", members: [{_id: 0, host: "mongodb-primary:27017" }]})'
mongo --host mongodb-primary:27017 << EOF
var cfg = {
"_id": "rs0",
"version": 1,
"members": [
{
"_id": 0,
"host": "mongodb:27017",
"host": "mongodb-primary:27017",
"priority": 2,
"votes": 1
},
Expand Down
Loading