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

FIWARE.Question.Tech.Data.OrionContextBroker.Data.CKAN.how to provision a datastore in ckan for connecting cygnus in column persistance mode?

    Details

      Description

      Created question in FIWARE Q/A platform on 21-04-2016 at 14:04
      Please, ANSWER this question AT http://stackoverflow.com/questions/36770274/how-to-provision-a-datastore-in-ckan-for-connecting-cygnus-in-column-persistance

      Question:
      how to provision a datastore in ckan for connecting cygnus in column persistance mode?

      Description:
      I am having the same problem as here and try to solve it, but I do not know how to properly format the datastore so cygnus will not throw the persistence error.

      My orion suscription is this one:

      (curl localhost:1026/v1/subscribeContext -s -S --header 'Content-Type: application/json' \
      -header 'Accept: application/json' -d @ | python -mjson.tool) <<EOF
      {
      "entities": [

      { "type": "Event", "isPattern": "false", "id": "es-leon-0" }

      ,

      { "type": "Event", "isPattern": "false", "id": "es-leon-1" }

      ],
      "attributes": [
      "IdEvent", "IdUser", "Title"
      ],
      "reference": "http://localhost:5050/notify",
      "duration": "P1M",
      "notifyConditions": [

      { "type": "ONCHANGE", "condValues": [ ] }

      ],
      "throttling": "PT5S"
      }
      EOF

      My cygnus config:

      ygnusagent.sources = http-source
      cygnusagent.sinks = ckan-sink
      cygnusagent.channels = ckan-channel

      cygnusagent.sources.http-source.channels = ckan-channel
      cygnusagent.sources.http-source.type = org.apache.flume.source.http.HTTPSource
      cygnusagent.sources.http-source.port = 5050
      cygnusagent.sources.http-source.handler = com.telefonica.iot.cygnus.handlers.OrionRestHandler
      cygnusagent.sources.http-source.handler.notification_target = /notify
      cygnusagent.sources.http-source.handler.default_service = Papel
      cygnusagent.sources.http-source.handler.default_service_path = Test
      cygnusagent.sources.http-source.handler.events_ttl = 5
      cygnusagent.sources.http-source.interceptors = ts gi
      cygnusagent.sources.http-source.interceptors.ts.type = timestamp
      cygnusagent.sources.http-source.interceptors.gi.type = com.telefonica.iot.cygnus.interceptors.GroupingInterceptor$Builder
      cygnusagent.sources.http-source.interceptors.gi.gropuing_rules_conf_file = /Applications/apache-flume-1.4.0-bin/conf/grouping_rules.conf

      cygnusagent.channels.ckan-channel.type = memory
      cygnusagent.channels.ckan-channel.capacity = 1000
      cygnusagent.channels.ckan-channel.transactionCapacity = 100

      1. ============================================
      2. OrionCKANSink configuration
      3. channel name from where to read notification events
        cygnusagent.sinks.ckan-sink.channel = ckan-channel
      1. sink class, must not be changed
        cygnusagent.sinks.ckan-sink.type = com.telefonica.iot.cygnus.sinks.OrionCKANSink
      1. true if the grouping feature is enabled for this sink, false otherwise
        cygnusagent.sinks.ckan-sink.enable_grouping = false
      1. true if lower case is wanted to forced in all the element names, false otherwise
        cygnusagent.sinks.hdfs-sink.enable_lowercase = false
      1. the CKAN API key to use
        cygnusagent.sinks.ckan-sink.api_key = xxxxx
      1. the FQDN/IP address for the CKAN API endpoint
        cygnusagent.sinks.ckan-sink.ckan_host = ckan-demo.ckan.io
      1. the port for the CKAN API endpoint
        cygnusagent.sinks.ckan-sink.ckan_port = 80
      1. Orion URL used to compose the resource URL with the convenience operation URL to query it
        cygnusagent.sinks.ckan-sink.orion_url = http://localhost:1026
      1. how the attributes are stored, either per row either per column (row, column)
        cygnusagent.sinks.ckan-sink.attr_persistence = column
      1. enable SSL for secure Http transportation; 'true' or 'false'
        cygnusagent.sinks.ckan-sink.ssl = false
      1. number of notifications to be included within a processing batch
        cygnusagent.sinks.ckan-sink.batch_size = 100
      1. timeout for batch accumulation
        cygnusagent.sinks.ckan-sink.batch_timeout = 60
      1. number of retries upon persistence error
        cygnusagent.sinks.ckan-sink.batch_ttl = 10

      Cygnus is receiving right it but then shows the following error:

      time=2016-04-21T07:44:57.504CDT | lvl=INFO | trans=1461242686-614-0000000001 | srv=Papel | subsrv=Test | function=getEvents | comp=Cygnus | msg=com.telefonica.iot.cygnus.handlers.OrionRestHandler[231] : Starting transaction (1461242686-614-0000000001)
      time=2016-04-21T07:44:57.528CDT | lvl=INFO | trans=1461242686-614-0000000001 | srv=Papel | subsrv=Test | function=getEvents | comp=Cygnus | msg=com.telefonica.iot.cygnus.handlers.OrionRestHandler[258] : Received data ({ "subscriptionId" : "571897360e94f9fa53829885", "originator" : "localhost", "contextResponses" : [ { "contextElement" : { "type" : "Event", "isPattern" : "false", "id" : "es-leon-0", "attributes" : [

      { "name" : "IdEvent", "type" : "text", "value" : "1084" }

      ,

      { "name" : "IdUser", "type" : "text", "value" : "18" }

      ,

      { "name" : "Title", "type" : "text", "value" : "Papes" }

      ] }, "statusCode" :

      { "code" : "200", "reasonPhrase" : "OK" }

      } ]})
      time=2016-04-21T07:44:57.528CDT | lvl=INFO | trans=1461242686-614-0000000001 | srv=Papel | subsrv=Test | function=getEvents | comp=Cygnus | msg=com.telefonica.iot.cygnus.handlers.OrionRestHandler[280] : Event put in the channel, id=2024732986
      time=2016-04-21T07:45:50.771CDT | lvl=INFO | trans=1461242686-614-0000000001 | srv=Papel | subsrv=Test | function=persistAggregation | comp=Cygnus | msg=com.telefonica.iot.cygnus.sinks.OrionCKANSink[417] : [ckan-sink] Persisting data at OrionCKANSink (orgName=papel, pkgName=papel_test, resName=es-leon-0_event, data=

      {"recvTime": "2016-04-21T12:44:57.497Z","fiwareServicePath": "Test","entityId": "es-leon-0","entityType": "Event","Title": "Papes"}

      ,

      {"recvTime": "2016-04-21T12:44:57.528Z","fiwareServicePath": "Test","entityId": "es-leon-0","entityType": "Event","IdEvent": "1084","IdUser": "18","Title": "Papes"}

      )
      time=2016-04-21T07:45:51.875CDT | lvl=ERROR | trans=1461242686-614-0000000001 | srv=Papel | subsrv=Test | function=processNewBatches | comp=Cygnus | msg=com.telefonica.iot.cygnus.sinks.OrionSink[426] : Runtime error (Cannot persist the data (orgName=papel, pkgName=papel_test, resName=es-leon-0_event))

      As said in here, I created the corresponding datastore: http://ckan-demo.ckan.io/dataset/papel-test/resource/8d7cb489-878e-465e-8c8c-60ea537411e0
      But don't know how to format it or if the csv is the correct format.

      Thanks

      **Note: I also found an error in the previewer software changing the title of my column "Title" to the title of the page "CKAN Demo".

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        3d 20h 6m 1 OKFN CKAN team 25/Apr/16 11:09 AM
        Closed Closed In Progress In Progress
        24m 38s 1 Manuel Escriche 26/Apr/16 11:34 AM
        In Progress In Progress Answered Answered
        6h 28m 2 Backlog Manager 26/Apr/16 6:02 PM
        Answered Answered Closed Closed
        2d 20h 59m 2 Backlog Manager 28/Apr/16 3:02 PM
        fla Fernando Lopez made changes -
        Fix Version/s 2021 [ 12600 ]
        backlogmanager Backlog Manager made changes -
        Summary FIWARE.Question.Tech.Data.CKAN.how to provision a datastore in ckan for connecting cygnus in column persistance mode? FIWARE.Question.Tech.Data.OrionContextBroker.Data.CKAN.how to provision a datastore in ckan for connecting cygnus in column persistance mode?
        Hide
        backlogmanager Backlog Manager added a comment -

        2016-04-28 15:05|UPDATED status: transition Finish| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2016-04-28 15:05|UPDATED status: transition Finish| # answers= 1, accepted answer= True
        backlogmanager Backlog Manager made changes -
        Resolution Done [ 10000 ]
        Status Answered [ 10104 ] Closed [ 6 ]
        Hide
        backlogmanager Backlog Manager added a comment -

        2016-04-26 18:05|UPDATED status: transition Answered| # answers= 1, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2016-04-26 18:05|UPDATED status: transition Answered| # answers= 1, accepted answer= False
        backlogmanager Backlog Manager made changes -
        Status In Progress [ 3 ] Answered [ 10104 ]
        fermin Fermín Galán made changes -
        Assignee Fermín Galán [ fermin ] Francisco Romero [ frb ]
        backlogmanager Backlog Manager made changes -
        Assignee Fermín Galán [ fermin ]
        mev Manuel Escriche made changes -
        Assignee OKFN CKAN team [ ckan-fiware-okfn ]
        mev Manuel Escriche made changes -
        HD-Enabler CKAN [ 10870 ] Orion [ 10875 ]
        mev Manuel Escriche made changes -
        Resolution Done [ 10000 ]
        Status Closed [ 6 ] In Progress [ 3 ]
        backlogmanager Backlog Manager made changes -
        Summary [fiware-stackoverflow] how to provision a datastore in ckan for connecting cygnus in column persistance mode? FIWARE.Question.Tech.Data.CKAN.how to provision a datastore in ckan for connecting cygnus in column persistance mode?
        HD-Node Unknown [ 10852 ]
        ckan-fiware-okfn OKFN CKAN team made changes -
        Resolution Done [ 10000 ]
        Status Answered [ 10104 ] Closed [ 6 ]
        ckan-fiware-okfn OKFN CKAN team made changes -
        Status In Progress [ 3 ] Answered [ 10104 ]
        ckan-fiware-okfn OKFN CKAN team made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Hide
        ckan-fiware-okfn OKFN CKAN team added a comment -

        Please direct this ticket to the maintainer of OrionCKANSink. http://fiware-cygnus.readthedocs.org/en/latest/flume_extensions_catalogue/orion_ckan_sink/

        Show
        ckan-fiware-okfn OKFN CKAN team added a comment - Please direct this ticket to the maintainer of OrionCKANSink. http://fiware-cygnus.readthedocs.org/en/latest/flume_extensions_catalogue/orion_ckan_sink/
        backlogmanager Backlog Manager made changes -
        Assignee OKFN CKAN team [ ckan-fiware-okfn ]
        backlogmanager Backlog Manager made changes -
        HD-Chapter Unknown [ 10845 ] Data [ 10838 ]
        mev Manuel Escriche made changes -
        HD-Enabler Unknown [ 10910 ] CKAN [ 10870 ]
        backlogmanager Backlog Manager made changes -
        HD-Enabler Unknown [ 10910 ]
        HD-Chapter Unknown [ 10845 ]
        HD-Node Unknown [ 10852 ]
        backlogmanager Backlog Manager made changes -
        Field Original Value New Value
        Component/s FIWARE-TECH-HELP [ 10278 ]
        Hide
        backlogmanager Backlog Manager added a comment -

        2016-04-21 15:05|CREATED monitor | # answers= 0, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2016-04-21 15:05|CREATED monitor | # answers= 0, accepted answer= False
        backlogmanager Backlog Manager created issue -

          People

          • Assignee:
            frb Francisco Romero
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: