Skip to content

Commit 323506d

Browse files
committed
Update to MongoDB 6.0
1 parent d8aa783 commit 323506d

File tree

4 files changed

+4
-27
lines changed

4 files changed

+4
-27
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ORION_LD_VERSION=1.6.0
88

99
# MongoDB variables
1010
MONGO_DB_PORT=27017
11-
MONGO_DB_VERSION=4.4
11+
MONGO_DB_VERSION=6.0
1212

1313
# Scorpio variables
1414
SCORPIO_PORT=9090

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
# IoT-Agent is configured for the JSON Protocol

docker-compose/orion-ld.yml

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

services

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -140,29 +140,9 @@ loadData () {
140140
--entrypoint /bin/ash quay.io/curl/curl:${CURL_VERSION} /import-data
141141
}
142142

143-
addDatabaseIndex () {
144-
printf "Adding appropriate \033[1mMongoDB\033[0m indexes for \033[1;34mOrion\033[0m ..."
145-
docker exec db-mongo mongo --eval '
146-
conn = new Mongo();db.createCollection("orion");
147-
db = conn.getDB("orion");
148-
db.createCollection("entities");
149-
db.entities.createIndex({"_id.servicePath": 1, "_id.id": 1, "_id.type": 1}, {unique: true});
150-
db.entities.createIndex({"_id.type": 1});
151-
db.entities.createIndex({"_id.id": 1});' > /dev/null
152-
153-
docker exec db-mongo mongo --eval '
154-
conn = new Mongo();db.createCollection("orion-openiot");
155-
db = conn.getDB("orion-openiot");
156-
db.createCollection("entities");
157-
db.entities.createIndex({"_id.servicePath": 1, "_id.id": 1, "_id.type": 1}, {unique: true});
158-
db.entities.createIndex({"_id.type": 1});
159-
db.entities.createIndex({"_id.id": 1});' > /dev/null
160-
echo -e " \033[1;32mdone\033[0m"
161-
}
162-
163143
addIoTDatabaseIndex () {
164144
printf "Adding appropriate \033[1mMongoDB\033[0m indexes for \033[1;36mIoT-Agent\033[0m ..."
165-
docker exec db-mongo mongo --eval '
145+
docker exec db-mongo mongosh --eval '
166146
conn = new Mongo();
167147
db = conn.getDB("iotagentjson");
168148
db.getCollectionNames().forEach(c=>db[c].drop());
@@ -218,7 +198,6 @@ case "${command}" in
218198
${dockerCmd} -f docker-compose/common.yml -f docker-compose/orion-ld.yml up -d --remove-orphans --renew-anon-volumes
219199
displayServices "orion|fiware"
220200
waitForMongo
221-
addDatabaseIndex
222201
addIoTDatabaseIndex
223202
waitForOrion
224203
export CONTEXT_BROKER=orion:1026

0 commit comments

Comments
 (0)