Skip to content

Commit e27b8e5

Browse files
committed
Update to MongoDB 6.0
1 parent 33106b6 commit e27b8e5

File tree

4 files changed

+3
-18
lines changed

4 files changed

+3
-18
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ CURL_VERSION=8.4.0
2121

2222
# MongoDB variables
2323
MONGO_DB_PORT=27017
24-
MONGO_DB_VERSION=4.4
24+
MONGO_DB_VERSION=6.0
2525

2626
# IoT Agent Ultralight Variables
2727
ULTRALIGHT_VERSION=3.4.0-distroless

docker-compose/common.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,7 @@ services:
5353
- mongo-db:/data/db
5454
- mongo-config:/data/configdb
5555
healthcheck:
56-
test: |
57-
host=`hostname --ip-address || echo '127.0.0.1'`;
58-
mongo --quiet $host/test --eval 'quit(db.runCommand({ ping: 1 }).ok ? 0 : 2)' && echo 0 || echo 1
56+
test: ["CMD","mongosh", "localhost:27017/test", "--quiet"]
5957
interval: 5s
6058

6159
# Tutorial acts as a series of dummy IoT Sensors over HTTP

docker-compose/orion-ld.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ services:
3232
- default
3333
ports:
3434
- ${EXPOSED_PORT:-1026}:${ORION_LD_PORT:-1026} # localhost:1026
35-
command: -dbhost mongo-db -logLevel DEBUG -forwarding -experimental
35+
command: -dbhost mongo-db -logLevel DEBUG -forwarding -mongocOnly
3636
healthcheck:
3737
test: curl --fail -s http://orion:${ORION_LD_PORT}/version || exit 1
3838
interval: 5s

services

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -129,18 +129,6 @@ stoppingContainers () {
129129
fi
130130
}
131131

132-
addDatabaseIndex () {
133-
printf "Create \033[1mMongoDB\033[0m database indexes ..."
134-
docker exec db-mongo mongo --eval '
135-
conn = new Mongo();db.createCollection("orion");
136-
db = conn.getDB("orion");
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-
144132
displayServices () {
145133
echo ""
146134
docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}" --filter name="$1"
@@ -164,7 +152,6 @@ case "${command}" in
164152
${dockerCmd} -f docker-compose/common.yml -f docker-compose/orion-ld.yml up -d --remove-orphans --renew-anon-volumes
165153
displayServices "orion|fiware"
166154
waitForMongo
167-
addDatabaseIndex
168155
waitForOrion
169156
waitForUserContext
170157
echo -e "\033[1;34m${command}\033[0m is now running and exposed on localhost:${EXPOSED_PORT}"

0 commit comments

Comments
 (0)