Details
-
Type:
Monitor
-
Status: Answered
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: FIWARE-TECH-HELP
-
Labels:
-
HD-Enabler:Orion
Description
Created question in FIWARE Q/A platform on 24-09-2019 at 13:09
Please, ANSWER this question AT https://stackoverflow.com/questions/58079389/enable-mongodb-sharding-for-fiware-orion-contextbroker
Question:
Enable MongoDB sharding for FIWARE Orion ContextBroker
Description:
I am trying to setup MongoDB sharding for the Orion ContextBroker, and IotAgent-Json, I am able to distribute the device provisioning and service data in MongoDb between shards, but whenever i sends the actual device data it gives following error:
I am using following command to shard the collection:
sh.shardCollection("orion.entities",
)
Intercept of ContextBroker log:
time=Tuesday 24 Sep 11:19:22 2019.846Z | lvl=ERROR | corr=28ee81ee-debd-11e9-84cc-3464a92017cd | trans=1569323345-406-00000000008 | from=127.0.0.1 | srv=fiwareiot | subsrv=/raw | comp=Orion | op=AlarmManager.cpp[211]:dbError | msg=Raising alarm DatabaseError: collection: orion.entities - update(): <{ _id.id: "DeviceEntity1", _id.type: "DeviceEntity", _id.servicePath:
What MongoDB shard key strategy should i follow, for following composite document id,
there may be multiple document for _id.id and _id.servicePath.
I want to distribute data with "_id.id": "DeviceEntity1" and "_id.id": "DeviceEntity2"in two MongoDB shards.
"_id" :
{ "id" : "DeviceEntity1", "type" : "DeviceEntity", "servicePath" : "/raw" },...
Thank You.
2019-09-24 15:05|CREATED monitor | # answers= 0, accepted answer= False