Skip to content

Commit 08396c6

Browse files
committed
Update Orion and MongoDB
1 parent 3fa6284 commit 08396c6

File tree

3 files changed

+9
-20
lines changed

3 files changed

+9
-20
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 JSON Variables
1313
JSON_VERSION=3.1.0-distroless

docker-compose.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ services:
8383
hostname: iot-sensors
8484
container_name: fiware-tutorial
8585
depends_on:
86-
- orion
86+
- orion-v2
8787
- iot-agent
8888
networks:
8989
default:
@@ -128,10 +128,11 @@ services:
128128
volumes:
129129
- mongo-db:/data
130130
healthcheck:
131-
test: |
132-
host=`hostname --ip-address || echo '127.0.0.1'`;
133-
mongo --quiet $host/test --eval 'quit(db.runCommand({ ping: 1 }).ok ? 0 : 2)' && echo 0 || echo 1
131+
test: ["CMD","mongosh", "--eval", "db.adminCommand('ping')"]
134132
interval: 5s
133+
timeout: 5s
134+
retries: 3
135+
start_period: 5s
135136

136137
networks:
137138
default:

services

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

6363
addDatabaseIndex () {
6464
printf "Adding appropriate \033[1mMongoDB\033[0m indexes for \033[1;34mOrion\033[0m ..."
65-
docker exec db-mongo mongo --eval '
65+
docker exec db-mongo mongosh --eval '
6666
conn = new Mongo();db.createCollection("orion");
6767
db = conn.getDB("orion");
6868
db.createCollection("entities");
6969
db.entities.createIndex({"_id.servicePath": 1, "_id.id": 1, "_id.type": 1}, {unique: true});
7070
db.entities.createIndex({"_id.type": 1});
7171
db.entities.createIndex({"_id.id": 1});' > /dev/null
7272

73-
docker exec db-mongo mongo --eval '
73+
docker exec db-mongo mongosh --eval '
7474
conn = new Mongo();db.createCollection("orion-openiot");
7575
db = conn.getDB("orion-openiot");
7676
db.createCollection("entities");
@@ -79,18 +79,6 @@ addDatabaseIndex () {
7979
db.entities.createIndex({"_id.id": 1});' > /dev/null
8080
echo -e " \033[1;32mdone\033[0m"
8181

82-
printf "Adding appropriate \033[1mMongoDB\033[0m indexes for \033[1;36mIoT-Agent\033[0m ..."
83-
docker exec db-mongo mongo --eval '
84-
conn = new Mongo();
85-
db = conn.getDB("iotagentul");
86-
db.createCollection("devices");
87-
db.devices.createIndex({"_id.service": 1, "_id.id": 1, "_id.type": 1});
88-
db.devices.createIndex({"_id.type": 1});
89-
db.devices.createIndex({"_id.id": 1});
90-
db.createCollection("groups");
91-
db.groups.createIndex({"_id.resource": 1, "_id.apikey": 1, "_id.service": 1});
92-
db.groups.createIndex({"_id.type": 1});' > /dev/null
93-
echo -e " \033[1;32mdone\033[0m"
9482
}
9583

9684
waitForMongo () {

0 commit comments

Comments
 (0)