Skip to content

Commit 1488cd2

Browse files
committed
Update to MongoDB 6.0
1 parent 4ad2ee3 commit 1488cd2

4 files changed

Lines changed: 8 additions & 29 deletions

File tree

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ STELLIO_TIMESCALE_POSTGIS=16-2.16.0-3.3
1717

1818
# MongoDB variables
1919
MONGO_DB_PORT=27017
20-
MONGO_DB_VERSION=4.4
20+
MONGO_DB_VERSION=6.0
2121

2222
# Tutorial variables
2323
TUTORIAL_APP_PORT=3000

docker-compose/common.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,11 @@ services:
4848
- "${MONGO_DB_PORT}:${MONGO_DB_PORT}" # localhost:27017
4949
networks:
5050
- default
51-
command: --nojournal
5251
volumes:
53-
- mongo-db:/data
52+
- mongo-db:/data/db
53+
- mongo-config:/data/configdb
5454
healthcheck:
55-
test: |
56-
host=`hostname --ip-address || echo '127.0.0.1'`;
57-
mongo --quiet $host/test --eval 'quit(db.runCommand({ ping: 1 }).ok ? 0 : 2)' && echo 0 || echo 1
55+
test: ["CMD","mongosh", "localhost:27017/test", "--quiet"]
5856
interval: 5s
5957

6058

@@ -91,6 +89,7 @@ networks:
9189

9290
volumes:
9391
mongo-db: ~
92+
mongo-config: ~
9493
data-models:
9594
driver: local
9695
driver_opts:

docker-compose/orion-ld.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ services:
2121
orion-ld:
2222
labels:
2323
org.fiware: 'tutorial'
24+
platform: linux/amd64
2425
image: quay.io/fiware/orion-ld:${ORION_LD_VERSION}
2526
hostname: orion
2627
container_name: fiware-orion-ld
@@ -29,8 +30,8 @@ services:
2930
networks:
3031
- default
3132
ports:
32-
- "${EXPOSED_PORT}:${ORION_LD_PORT}" # localhost:1026
33-
command: -dbhost mongo-db -logLevel DEBUG -experimental
33+
- ${EXPOSED_PORT:-1026}:${ORION_LD_PORT:-1026} # localhost:1026
34+
command: -dbhost mongo-db -logLevel DEBUG -forwarding -mongocOnly
3435
healthcheck:
3536
test: curl --fail -s http://orion:${ORION_LD_PORT}/version || exit 1
3637
interval: 5s

services

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -121,26 +121,6 @@ loadData () {
121121
--entrypoint /bin/ash quay.io/curl/curl /import-data
122122
}
123123

124-
addDatabaseIndex () {
125-
printf "Adding appropriate \033[1mMongoDB\033[0m indexes for \033[1;34mOrion\033[0m ..."
126-
docker exec db-mongo mongo --eval '
127-
conn = new Mongo();db.createCollection("orion");
128-
db = conn.getDB("orion");
129-
db.createCollection("entities");
130-
db.entities.createIndex({"_id.servicePath": 1, "_id.id": 1, "_id.type": 1}, {unique: true});
131-
db.entities.createIndex({"_id.type": 1});
132-
db.entities.createIndex({"_id.id": 1});' > /dev/null
133-
134-
docker exec db-mongo mongo --eval '
135-
conn = new Mongo();db.createCollection("orion-openiot");
136-
db = conn.getDB("orion-openiot");
137-
db.createCollection("entities");
138-
db.entities.createIndex({"_id.servicePath": 1, "_id.id": 1, "_id.type": 1}, {unique: true});
139-
db.entities.createIndex({"_id.type": 1});
140-
db.entities.createIndex({"_id.id": 1});' > /dev/null
141-
echo -e " \033[1;32mdone\033[0m"
142-
}
143-
144124
stoppingContainers () {
145125
CONTAINERS=$(docker ps -aq)
146126
if [[ -n $CONTAINERS ]]; then
@@ -176,7 +156,6 @@ case "${command}" in
176156
echo ""
177157
${dockerCmd} -f docker-compose/common.yml -f docker-compose/orion-ld.yml up -d --remove-orphans --renew-anon-volumes
178158
waitForMongo
179-
addDatabaseIndex
180159
waitForOrionLD
181160
export CONTEXT_BROKER=orion:1026
182161
loadData

0 commit comments

Comments
 (0)