Fiware 天鹅座没有';更新数据库

Fiware 天鹅座没有';更新数据库,fiware,fiware-cygnus,Fiware,Fiware Cygnus,我想订阅Orion向Cygnus发送通知。然后cygnus将所有数据保存在mysql数据库中。我使用这个脚本订阅car1的speed属性 (curl 130.206.118.44:1026/v1/subscribeContext -s -S --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Fiware-Service: vehicles' --header 'Fiwar

我想订阅Orion向Cygnus发送通知。然后cygnus将所有数据保存在mysql数据库中。我使用这个脚本订阅car1的speed属性

(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
有关我的cygnus服务和cygnus配置的一些信息(
systemctl status cygnus
):

agent_mysql.conf:

# main configuration
cygnusagent.sources = http-source
cygnusagent.sinks = mysql-sink
cygnusagent.channels = mysql-channel

# 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

# 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
# mysqldb ip
cygnusagent.sinks.mysql-sink.mysql_host = 127.0.0.1
# 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

# configuracao do canal mysql
cygnusagent.channels.mysql-channel.type = memory
cygnusagent.channels.mysql-channel.capacity = 1000
cygnusagent.channels.mysql-channel.transactionCapacity = 100
在阅读了问题之后,我在这行中更改了我的agent_mysql.conf:
cygnusagent.sinks.mysql-sink.attr_persistence=column
cygnusagent.sinks.mysql-sink.attr_persistence=row
并重新启动服务。然后我更新了orion实体,查询了数据库,什么也没发生

天鹅座日志文件:
http://pastebin.com/B2FNKcVf


注意:我的JAVA_主页已设置。

正如您在发布的日志中所看到的,Cygnus日志文件存在问题:

java.io.FileNotFoundException: ./logs/cygnus.log (No such file or directory)
之后,天鹅座停了下来。您必须检查关于log4j的配置,所有内容都位于
/usr/cygnus/conf/log4j.properties
(它应该存在,它是由RPM创建的……如果不存在,因为它是从源代码而不是RPM创建的,它必须从可用的模板创建)。另外,您可以发布实例配置文件吗?不管怎样,你正在运行哪个版本

编辑1

最近,我们发现另一个用户处理相同的错误,问题是
/usr/cygnus/conf/log4j的内容

flume.root.logger=INFO,LOGFILE
flume.log.dir=./log
flume.log.file=flume.log
而不是模板包含的内容:

flume.root.logger=INFO,LOGFILE
flume.log.dir=/var/log/cygnus/
flume.log.file=flume.log

一旦更改,它就工作了,因为RPM创建的是
/var/log/cygnus
,而不是
/log

您的配置似乎正常。你能分享一下天鹅座跑步的全部记录吗?请使用gist或pastebin。关于attr_持久性,正如您在链接问题中已经注意到的,如果您将其配置为“column”,那么Cygnus将不会创建表,但它必须由您设置。相反,如果使用“行”,它是由天鹅座自动创建的。@frb我更新了问题。
flume.root.logger=INFO,LOGFILE
flume.log.dir=./log
flume.log.file=flume.log
flume.root.logger=INFO,LOGFILE
flume.log.dir=/var/log/cygnus/
flume.log.file=flume.log