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

[fiware-stackoverflow] Cygnus didn't update database

    Details

      Description

      Created question in FIWARE Q/A platform on 21-10-2015 at 20:10
      Please, ANSWER this question AT https://stackoverflow.com/questions/33266446/cygnus-didnt-update-database

      Question:
      Cygnus didn't update database

      Description:
      I want to subscribe Orion to send notifications to Cygnus. Then cygnus will save all data in mysql database. I use this script to subscribe the speed attribute of car1.

      (curl 130.206.118.44:1026/v1/subscribeContext s -S --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Fiware-Service: vehicles' --header 'Fiware-ServicePath: /4wheels' -d @ | python -mjson.tool) <<EOF
      {
      "entities": [

      { "type": "car", "isPattern": "false", "id": "car1" }

      ],
      "attributes": [
      "speed",
      "oil_level"
      ],
      "reference": "http://192.168.1.49:5050/notify",
      "duration": "P1M",
      "notifyConditions": [

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

      ],
      "throttling": "PT1S"
      }
      EOF

      But when I update the speed attribute of car 1, cygnus doesn't update the database.

      Databases available:

      mysql> show databases;
      --------------------

      Database

      --------------------

      information_schema
      mysql
      performance_schema

      --------------------
      3 rows in set (0.00 sec)

      Some information about my cygnus service and my cygnus configuration (systemctl status cygnus):

      cygnus.service - SYSV: cygnus
      Loaded: loaded (/etc/rc.d/init.d/cygnus)
      Active: active (exited) since Wed 2015-10-21 17:54:07 UTC; 8min ago
      Process: 31566 ExecStop=/etc/rc.d/init.d/cygnus stop (code=exited, status=0/SUCCESS)
      Process: 31588 ExecStart=/etc/rc.d/init.d/cygnus start (code=exited, status=0/SUCCESS)

      Oct 21 17:54:05 cygnus systemd[1]: Starting SYSV: cygnus...
      Oct 21 17:54:05 cygnus su[31593]: (to cygnus) root on none
      Oct 21 17:54:07 cygnus cygnus[31588]: Starting Cygnus mysql... [ OK ]
      Oct 21 17:54:07 cygnus systemd[1]: Started SYSV: cygnus.

      agent_mysql.conf:

      1. main configuration
        cygnusagent.sources = http-source
        cygnusagent.sinks = mysql-sink
        cygnusagent.channels = mysql-channel
      1. source configuration
        cygnusagent.sources.http-source.channels = mysql-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
      1. url target
        cygnusagent.sources.http-source.handler.notification_target = /notify
        cygnusagent.sources.http-source.handler.default_service = def_serv
        cygnusagent.sources.http-source.handler.default_service_path = def_servpath
        cygnusagent.sources.http-source.handler.events_ttl = 10
        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.grouping_rules_conf_file = /usr/cygnus/conf/grouping_rules.conf

      #Orion MysqlSink Configuration
      cygnusagent.sinks.mysql-sink.channel = mysql-channel
      cygnusagent.sinks.mysql-sink.type = com.telefonica.iot.cygnus.sinks.OrionMySQLSink
      cygnusagent.sinks.mysql-sink.enable_grouping = false

      1. mysqldb ip
        cygnusagent.sinks.mysql-sink.mysql_host = 127.0.0.1
      2. mysqldb port
        cygnusagent.sinks.mysql-sink.mysql_port = 3306
        cygnusagent.sinks.mysql-sink.mysql_username = root
        cygnusagent.sinks.mysql-sink.mysql_password = 12345
        cygnusagent.sinks.mysql-sink.attr_persistence = column
        cygnusagent.sinks.mysql-sink.table_type = table-by-destination
      1. configuracao do canal mysql
        cygnusagent.channels.mysql-channel.type = memory
        cygnusagent.channels.mysql-channel.capacity = 1000
        cygnusagent.channels.mysql-channel.transactionCapacity = 100

      After read this question, I changed my agent_mysql.conf in this line:
      cygnusagent.sinks.mysql-sink.attr_persistence = column to cygnusagent.sinks.mysql-sink.attr_persistence = row and restarted the service. Then I updated orion entity and I queried database and nothing happened.

      Cygnus log file: http://pastebin.com/B2FNKcVf

      Note: My JAVA_HOME is set.

        Activity

        Hide
        backlogmanager Backlog Manager added a comment -

        2017-05-22 15:18|CREATED monitor | # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2017-05-22 15:18|CREATED monitor | # answers= 1, accepted answer= True
        Hide
        backlogmanager Backlog Manager added a comment -

        2017-05-22 18:12|UPDATED status: transition Answer| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2017-05-22 18:12|UPDATED status: transition Answer| # answers= 1, accepted answer= True
        Hide
        backlogmanager Backlog Manager added a comment -

        2017-05-22 21:12|UPDATED status: transition Finish| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2017-05-22 21:12|UPDATED status: transition Finish| # answers= 1, accepted answer= True

          People

          • Assignee:
            backlogmanager Backlog Manager
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: