本文介绍了为什么在Orion中使用ngsiv2时天鹅座会崩溃?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我开始使用NGSIV2,但是天鹅座开始崩溃.我可以准备一些没变的东西吗?使用v1可以完美无瑕.

我的错误启动记录在这里: http://pastebin.com/nP2am8GW

错误说:将事件附加到通道时出错.频道可能已满.考虑增加信道容量或确保接收器性能更快.

time=2016-05-09T05:58:28.866CDT | lvl=WARN | trans=1462791485-602-0000000000 | srv=papel-club | subsrv=events | function=intercept | comp=Cygnus | msg=com.telefonica.iot.cygnus.interceptors.GroupingInterceptor[135] : No context responses within the notified entity, nothing is done
time=2016-05-09T05:58:28.867CDT | lvl=WARN | trans=1462791485-602-0000000000 | srv=papel-club | subsrv=events | function=doPost | comp=Cygnus | msg=org.apache.flume.source.http.HTTPSource$FlumeHTTPServlet[203] : Error appending event to channel. Channel might be full. Consider increasing the channel capacity or make sure the sinks perform faster.
org.apache.flume.ChannelException: Unable to put batch on required channel: org.apache.flume.channel.MemoryChannel{name: ckan-channel}
    at org.apache.flume.channel.ChannelProcessor.processEventBatch(ChannelProcessor.java:200)
    at org.apache.flume.source.http.HTTPSource$FlumeHTTPServlet.doPost(HTTPSource.java:201)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:814)
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:401)
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.Server.handle(Server.java:326)
    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
    at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:945)
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
    at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
    at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
Caused by: java.lang.IllegalArgumentException: put() called with null event!
    at com.google.common.base.Preconditions.checkArgument(Preconditions.java:88)
    at org.apache.flume.channel.BasicTransactionSemantics.put(BasicTransactionSemantics.java:89)
    at org.apache.flume.channel.BasicChannelSemantics.put(BasicChannelSemantics.java:80)
    at org.apache.flume.channel.ChannelProcessor.processEventBatch(ChannelProcessor.java:189)
    ... 16 more

由于错误,我增加了通道内存.这是我的代理配置:

cygnusagent.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-club
cygnusagent.sources.http-source.handler.default_service_path = /events
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.grouping_rules_conf_file = /usr/cygnus/conf/grouping_rules_day.conf

cygnusagent.channels.ckan-channel.type = memory
cygnusagent.channels.ckan-channel.capacity = 100000
cygnusagent.channels.ckan-channel.transactionCapacity = 100000

# ============================================
# OrionCKANSink configuration
# channel name from where to read notification events
cygnusagent.sinks.ckan-sink.channel = ckan-channel

# sink class, must not be changed
cygnusagent.sinks.ckan-sink.type = com.telefonica.iot.cygnus.sinks.OrionCKANSink

# true if the grouping feature is enabled for this sink, false otherwise
cygnusagent.sinks.ckan-sink.enable_grouping = true

# true if lower case is wanted to forced in all the element names, false otherwise
cygnusagent.sinks.hdfs-sink.enable_lowercase = false

# the CKAN API key to use
cygnusagent.sinks.ckan-sink.api_key = xxxx

# the FQDN/IP address for the CKAN API endpoint
cygnusagent.sinks.ckan-sink.ckan_host = ckan-demo.ckan.io

# the port for the CKAN API endpoint
cygnusagent.sinks.ckan-sink.ckan_port = 80

# 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

# how the attributes are stored, either per row either per column (row, column)
cygnusagent.sinks.ckan-sink.attr_persistence = column

# enable SSL for secure Http transportation; 'true' or 'false'
cygnusagent.sinks.ckan-sink.ssl = false

# number of notifications to be included within a processing batch
cygnusagent.sinks.ckan-sink.batch_size = 100

# timeout for batch accumulation
cygnusagent.sinks.ckan-sink.batch_timeout = 60

# number of retries upon persistence error
cygnusagent.sinks.ckan-sink.batch_ttl = 10

谢谢.

解决方案

目前,Cygnus不支持NGSIv2.预计将要实施,但尚未安排. >

编辑:请注意,您可以使用NGSIv2在Orion上创建/更新实体,并在NGSIv1中具有以下通知:

  • 使用NGSIv1操作创建订阅
  • 使用NGSIv2操作(attrsFormat等于legacy)创建预订.请查看更详细的信息这里.

Recently I start working with NGSIV2 but cygnus start crashing.May I have something not cofigurated right? With the v1 works flawless.

My startup trace with the error is in here: http://pastebin.com/nP2am8GW

The error said: Error appending event to channel. Channel might be full. Consider increasing the channel capacity or make sure the sinks perform faster.

time=2016-05-09T05:58:28.866CDT | lvl=WARN | trans=1462791485-602-0000000000 | srv=papel-club | subsrv=events | function=intercept | comp=Cygnus | msg=com.telefonica.iot.cygnus.interceptors.GroupingInterceptor[135] : No context responses within the notified entity, nothing is done
time=2016-05-09T05:58:28.867CDT | lvl=WARN | trans=1462791485-602-0000000000 | srv=papel-club | subsrv=events | function=doPost | comp=Cygnus | msg=org.apache.flume.source.http.HTTPSource$FlumeHTTPServlet[203] : Error appending event to channel. Channel might be full. Consider increasing the channel capacity or make sure the sinks perform faster.
org.apache.flume.ChannelException: Unable to put batch on required channel: org.apache.flume.channel.MemoryChannel{name: ckan-channel}
    at org.apache.flume.channel.ChannelProcessor.processEventBatch(ChannelProcessor.java:200)
    at org.apache.flume.source.http.HTTPSource$FlumeHTTPServlet.doPost(HTTPSource.java:201)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:814)
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:401)
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.Server.handle(Server.java:326)
    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
    at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:945)
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
    at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
    at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
Caused by: java.lang.IllegalArgumentException: put() called with null event!
    at com.google.common.base.Preconditions.checkArgument(Preconditions.java:88)
    at org.apache.flume.channel.BasicTransactionSemantics.put(BasicTransactionSemantics.java:89)
    at org.apache.flume.channel.BasicChannelSemantics.put(BasicChannelSemantics.java:80)
    at org.apache.flume.channel.ChannelProcessor.processEventBatch(ChannelProcessor.java:189)
    ... 16 more

As error said i increase the channel memory. Here is my agent config:

cygnusagent.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-club
cygnusagent.sources.http-source.handler.default_service_path = /events
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.grouping_rules_conf_file = /usr/cygnus/conf/grouping_rules_day.conf

cygnusagent.channels.ckan-channel.type = memory
cygnusagent.channels.ckan-channel.capacity = 100000
cygnusagent.channels.ckan-channel.transactionCapacity = 100000

# ============================================
# OrionCKANSink configuration
# channel name from where to read notification events
cygnusagent.sinks.ckan-sink.channel = ckan-channel

# sink class, must not be changed
cygnusagent.sinks.ckan-sink.type = com.telefonica.iot.cygnus.sinks.OrionCKANSink

# true if the grouping feature is enabled for this sink, false otherwise
cygnusagent.sinks.ckan-sink.enable_grouping = true

# true if lower case is wanted to forced in all the element names, false otherwise
cygnusagent.sinks.hdfs-sink.enable_lowercase = false

# the CKAN API key to use
cygnusagent.sinks.ckan-sink.api_key = xxxx

# the FQDN/IP address for the CKAN API endpoint
cygnusagent.sinks.ckan-sink.ckan_host = ckan-demo.ckan.io

# the port for the CKAN API endpoint
cygnusagent.sinks.ckan-sink.ckan_port = 80

# 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

# how the attributes are stored, either per row either per column (row, column)
cygnusagent.sinks.ckan-sink.attr_persistence = column

# enable SSL for secure Http transportation; 'true' or 'false'
cygnusagent.sinks.ckan-sink.ssl = false

# number of notifications to be included within a processing batch
cygnusagent.sinks.ckan-sink.batch_size = 100

# timeout for batch accumulation
cygnusagent.sinks.ckan-sink.batch_timeout = 60

# number of retries upon persistence error
cygnusagent.sinks.ckan-sink.batch_ttl = 10

Thanks.

解决方案

For the time being, NGSIv2 is not supported in Cygnus. It is expected to be implemented, but it has not been scheduled yet.

EDIT: note also that you can use NGSIv2 to create/update entities at Orion and have notifications in NGSIv1 if you:

  • Create the subscription using NGSIv1 operations
  • Create the subscription using NGSIv2 operations with attrsFormat equal to legacy. Have a look to more detailed information here.

这篇关于为什么在Orion中使用ngsiv2时天鹅座会崩溃?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-15 22:02