Skip to content

Commit 9e32e17

Browse files
committed
Update Orion and MongoDB
1 parent 074540a commit 9e32e17

3 files changed

Lines changed: 9 additions & 20 deletions

File tree

.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: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ services:
9999
hostname: iot-sensors
100100
container_name: fiware-tutorial
101101
depends_on:
102-
- orion
102+
- orion-v2
103103
- quantumleap
104104
networks:
105105
default:
@@ -146,10 +146,12 @@ services:
146146
volumes:
147147
- mongo-db:/data
148148
healthcheck:
149-
test: [ "CMD", "mongo", "--quiet", "127.0.0.1/test", "--eval", "'quit(db.runCommand({ ping: 1 }).ok ? 0 : 2)'"]
149+
test: ["CMD","mongosh", "--eval", "db.adminCommand('ping')"]
150150
interval: 5s
151+
timeout: 5s
152+
retries: 3
153+
start_period: 5s
151154

152-
153155
crate-db:
154156
labels:
155157
org.fiware: 'tutorial'

services

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -74,35 +74,22 @@ displayServices () {
7474

7575
addDatabaseIndex () {
7676
printf "Adding appropriate \033[1mMongoDB\033[0m indexes for \033[1;34mOrion\033[0m ..."
77-
docker exec db-mongo mongo --eval '
77+
docker exec db-mongo mongosh --eval '
7878
conn = new Mongo();db.createCollection("orion");
7979
db = conn.getDB("orion");
8080
db.createCollection("entities");
8181
db.entities.createIndex({"_id.servicePath": 1, "_id.id": 1, "_id.type": 1}, {unique: true});
8282
db.entities.createIndex({"_id.type": 1});
8383
db.entities.createIndex({"_id.id": 1});' > /dev/null
8484

85-
docker exec db-mongo mongo --eval '
85+
docker exec db-mongo mongosh --eval '
8686
conn = new Mongo();db.createCollection("orion-openiot");
8787
db = conn.getDB("orion-openiot");
8888
db.createCollection("entities");
8989
db.entities.createIndex({"_id.servicePath": 1, "_id.id": 1, "_id.type": 1}, {unique: true});
9090
db.entities.createIndex({"_id.type": 1});
9191
db.entities.createIndex({"_id.id": 1});' > /dev/null
9292
echo -e " \033[1;32mdone\033[0m"
93-
94-
printf "Adding appropriate \033[1mMongoDB\033[0m indexes for \033[1;36mIoT-Agent\033[0m ..."
95-
docker exec db-mongo mongo --eval '
96-
conn = new Mongo();
97-
db = conn.getDB("iotagentul");
98-
db.createCollection("devices");
99-
db.devices.createIndex({"_id.service": 1, "_id.id": 1, "_id.type": 1});
100-
db.devices.createIndex({"_id.type": 1});
101-
db.devices.createIndex({"_id.id": 1});
102-
db.createCollection("groups");
103-
db.groups.createIndex({"_id.resource": 1, "_id.apikey": 1, "_id.service": 1});
104-
db.groups.createIndex({"_id.type": 1});' > /dev/null
105-
echo -e " \033[1;32mdone\033[0m"
10693
}
10794

10895
waitForMongo () {

0 commit comments

Comments
 (0)