Skip to content

Commit 1ab1989

Browse files
committed
Update Orion and MongoDB
1 parent bd8ea34 commit 1ab1989

File tree

3 files changed

+10
-21
lines changed

3 files changed

+10
-21
lines changed

.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ COMPOSE_PROJECT_NAME=fiware
33

44
# Orion variables
55
ORION_PORT=1026
6-
ORION_VERSION=3.10.1
6+
ORION_VERSION=3.11.0
77

88
# MongoDB variables
99
MONGO_DB_PORT=27017
10-
MONGO_DB_VERSION=4.4
10+
MONGO_DB_VERSION=6.0
1111

1212
# Tutorial variables
1313
TUTORIAL_APP_PORT=3000

docker-compose.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
#
1919
version: "3.8"
2020
services:
21-
# Orion is the context broker
22-
orion:
21+
# Orion is an NGSI-v2 context broker
22+
orion-v2:
2323
labels:
2424
org.fiware: 'tutorial'
2525
image: quay.io/fiware/orion:${ORION_VERSION}
@@ -236,10 +236,11 @@ services:
236236
volumes:
237237
- mongo-db:/data
238238
healthcheck:
239-
test: |
240-
host=`hostname --ip-address || echo '127.0.0.1'`;
241-
mongo --quiet $host/test --eval 'quit(db.runCommand({ ping: 1 }).ok ? 0 : 2)' && echo 0 || echo 1
239+
test: ["CMD","mongosh", "--eval", "db.adminCommand('ping')"]
242240
interval: 5s
241+
timeout: 5s
242+
retries: 3
243+
start_period: 5s
243244

244245

245246
mysql-db:

services

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,15 @@ displayServices () {
9292

9393
addDatabaseIndex () {
9494
printf "Adding appropriate \033[1mMongoDB\033[0m indexes for \033[1;34mOrion\033[0m ..."
95-
docker exec db-mongo mongo --eval '
95+
docker exec db-mongo mongosh --eval '
9696
conn = new Mongo();db.createCollection("orion");
9797
db = conn.getDB("orion");
9898
db.createCollection("entities");
9999
db.entities.createIndex({"_id.servicePath": 1, "_id.id": 1, "_id.type": 1}, {unique: true});
100100
db.entities.createIndex({"_id.type": 1});
101101
db.entities.createIndex({"_id.id": 1});' > /dev/null
102102

103-
docker exec db-mongo mongo --eval '
103+
docker exec db-mongo mongosh --eval '
104104
conn = new Mongo();db.createCollection("orion-openiot");
105105
db = conn.getDB("orion-openiot");
106106
db.createCollection("entities");
@@ -109,18 +109,6 @@ addDatabaseIndex () {
109109
db.entities.createIndex({"_id.id": 1});' > /dev/null
110110
echo -e " \033[1;32mdone\033[0m"
111111

112-
printf "Adding appropriate \033[1mMongoDB\033[0m indexes for \033[1;36mIoT-Agent\033[0m ..."
113-
docker exec db-mongo mongo --eval '
114-
conn = new Mongo();
115-
db = conn.getDB("iotagentul");
116-
db.createCollection("devices");
117-
db.devices.createIndex({"_id.service": 1, "_id.id": 1, "_id.type": 1});
118-
db.devices.createIndex({"_id.type": 1});
119-
db.devices.createIndex({"_id.id": 1});
120-
db.createCollection("groups");
121-
db.groups.createIndex({"_id.resource": 1, "_id.apikey": 1, "_id.service": 1});
122-
db.groups.createIndex({"_id.type": 1});' > /dev/null
123-
echo -e " \033[1;32mdone\033[0m"
124112
}
125113

126114
startContainers () {

0 commit comments

Comments
 (0)