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

        backlogmanager Backlog Manager created issue -
        backlogmanager Backlog Manager made changes -
        Field Original Value New Value
        Component/s FIWARE-TECH-HELP [ 10278 ]
        fla Fernando Lopez made changes -
        Assignee Fermín Galán [ fermin ]
        fla Fernando Lopez made changes -
        HD-Enabler Orion [ 10875 ]
        Description
        Created question in FIWARE Q/A platform on 24-09-2019 at 13:09
        {color: red}Please, ANSWER this question AT{color} 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(): &lt;{ _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.
        Created question in FIWARE Q/A platform on 24-09-2019 at 13:09
        {color: red}Please, ANSWER this question AT{color} 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(): &lt;{ _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.
        fla Fernando Lopez made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        backlogmanager Backlog Manager made changes -
        Status In Progress [ 3 ] Answered [ 10104 ]

          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: