Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-16179

[fiware-stackoverflow] Enable MongoDB sharding for FIWARE Orion ContextBroker

    Details

      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:

      { "name": "ENTITY_GENERIC_ERROR", "message": "Error accesing entity data for device: DeviceEntity1 of type: DeviceEntity1"}

      I am using following command to shard the collection:
      sh.shardCollection("orion.entities",

      {"_id.servicePath": 1, "_id.id": 1, "_id.type": 1}

      )

      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.

        Activity

        Hide
        backlogmanager Backlog Manager added a comment -

        2019-09-24 15:05|CREATED monitor | # answers= 0, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2019-09-24 15:05|CREATED monitor | # answers= 0, accepted answer= False
        Hide
        backlogmanager Backlog Manager added a comment -

        2019-09-26 21:05|UPDATED status: transition Answered| # answers= 1, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2019-09-26 21:05|UPDATED status: transition Answered| # answers= 1, accepted answer= False

          People

          • Assignee:
            fermin Fermín Galán
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: