Skip to content

Commit 0b45ba2

Browse files
committed
Update Orion and MongoDB
1 parent 2abbfef commit 0b45ba2

File tree

6 files changed

+28
-36
lines changed

6 files changed

+28
-36
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/northport-wilma.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}
@@ -224,10 +224,11 @@ services:
224224
volumes:
225225
- mongo-db:/data
226226
healthcheck:
227-
test: |
228-
host=`hostname --ip-address || echo '127.0.0.1'`;
229-
mongo --quiet $host/test --eval 'quit(db.runCommand({ ping: 1 }).ok ? 0 : 2)' && echo 0 || echo 1
227+
test: ["CMD","mongosh", "--eval", "db.adminCommand('ping')"]
230228
interval: 5s
229+
timeout: 5s
230+
retries: 3
231+
start_period: 5s
231232

232233

233234
mysql-db:

docker-compose/orion-kong.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}
@@ -200,10 +200,11 @@ services:
200200
volumes:
201201
- mongo-db:/data
202202
healthcheck:
203-
test: |
204-
host=`hostname --ip-address || echo '127.0.0.1'`;
205-
mongo --quiet $host/test --eval 'quit(db.runCommand({ ping: 1 }).ok ? 0 : 2)' && echo 0 || echo 1
203+
test: ["CMD","mongosh", "--eval", "db.adminCommand('ping')"]
206204
interval: 5s
205+
timeout: 5s
206+
retries: 3
207+
start_period: 5s
207208

208209

209210
mysql-db:

docker-compose/orion-wilma.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}
@@ -211,10 +211,11 @@ services:
211211
volumes:
212212
- mongo-db:/data
213213
healthcheck:
214-
test: |
215-
host=`hostname --ip-address || echo '127.0.0.1'`;
216-
mongo --quiet $host/test --eval 'quit(db.runCommand({ ping: 1 }).ok ? 0 : 2)' && echo 0 || echo 1
214+
test: ["CMD","mongosh", "--eval", "db.adminCommand('ping')"]
217215
interval: 5s
216+
timeout: 5s
217+
retries: 3
218+
start_period: 5s
218219

219220

220221
mysql-db:

docker-compose/southport-wilma.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}
@@ -249,10 +249,11 @@ services:
249249
volumes:
250250
- mongo-db:/data
251251
healthcheck:
252-
test: |
253-
host=`hostname --ip-address || echo '127.0.0.1'`;
254-
mongo --quiet $host/test --eval 'quit(db.runCommand({ ping: 1 }).ok ? 0 : 2)' && echo 0 || echo 1
252+
test: ["CMD","mongosh", "--eval", "db.adminCommand('ping')"]
255253
interval: 5s
254+
timeout: 5s
255+
retries: 3
256+
start_period: 5s
256257

257258

258259
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)