Skip to content

Commit 7264b73

Browse files
committed
Update Orion and MongoDB
1 parent 9e301ab commit 7264b73

File tree

3 files changed

+11
-22
lines changed

3 files changed

+11
-22
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
# IoT Agent Ultralight Variables
1313
ULTRALIGHT_VERSION=3.1.0-distroless

docker-compose.yml

Lines changed: 7 additions & 6 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}
@@ -90,7 +90,7 @@ services:
9090
hostname: iot-sensors
9191
container_name: fiware-tutorial
9292
depends_on:
93-
- orion
93+
- orion-v2
9494
- iot-agent
9595
networks:
9696
default:
@@ -137,10 +137,11 @@ services:
137137
volumes:
138138
- mongo-db:/data
139139
healthcheck:
140-
test: |
141-
host=`hostname --ip-address || echo '127.0.0.1'`;
142-
mongo --quiet $host/test --eval 'quit(db.runCommand({ ping: 1 }).ok ? 0 : 2)' && echo 0 || echo 1
140+
test: ["CMD","mongosh", "--eval", "db.adminCommand('ping')"]
143141
interval: 5s
142+
timeout: 5s
143+
retries: 3
144+
start_period: 5s
144145

145146

146147
# Other services

services

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

5151
addDatabaseIndex () {
5252
printf "Adding appropriate \033[1mMongoDB\033[0m indexes for \033[1;34mOrion\033[0m ..."
53-
docker exec db-mongo mongo --eval '
53+
docker exec db-mongo mongosh --eval '
5454
conn = new Mongo();db.createCollection("orion");
5555
db = conn.getDB("orion");
5656
db.createCollection("entities");
5757
db.entities.createIndex({"_id.servicePath": 1, "_id.id": 1, "_id.type": 1}, {unique: true});
5858
db.entities.createIndex({"_id.type": 1});
5959
db.entities.createIndex({"_id.id": 1});' > /dev/null
6060

61-
docker exec db-mongo mongo --eval '
61+
docker exec db-mongo mongosh --eval '
6262
conn = new Mongo();db.createCollection("orion-openiot");
6363
db = conn.getDB("orion-openiot");
6464
db.createCollection("entities");
@@ -67,18 +67,6 @@ addDatabaseIndex () {
6767
db.entities.createIndex({"_id.id": 1});' > /dev/null
6868
echo -e " \033[1;32mdone\033[0m"
6969

70-
printf "Adding appropriate \033[1mMongoDB\033[0m indexes for \033[1;36mIoT-Agent\033[0m ..."
71-
docker exec db-mongo mongo --eval '
72-
conn = new Mongo();
73-
db = conn.getDB("iotagentul");
74-
db.createCollection("devices");
75-
db.devices.createIndex({"_id.service": 1, "_id.id": 1, "_id.type": 1});
76-
db.devices.createIndex({"_id.type": 1});
77-
db.devices.createIndex({"_id.id": 1});
78-
db.createCollection("groups");
79-
db.groups.createIndex({"_id.resource": 1, "_id.apikey": 1, "_id.service": 1});
80-
db.groups.createIndex({"_id.type": 1});' > /dev/null
81-
echo -e " \033[1;32mdone\033[0m"
8270
}
8371

8472
waitForMongo () {

0 commit comments

Comments
 (0)