2016-04-28 12 views
4

今、私はすべてのエンティティ情報を使って私のorionデータ用のデータセットを作成しようとしています。 すべて正しく設定されていて、一部のデータがorionでcygnusに通知され、cygnusがそのデータをckanに追加します。 この画像に見られるように。cygnusを使用して複数のorionエンティティを1つのckanデータセットに結合する方法は?

My arquitecture

問題はシグナスは、各エンティティのCKANリソースを作成することです。 cygnusにすべてのデータを1つのリソースに入れるにはどうすればよいですか?おかげさまで

EDIT 1:

私はちょうど私がオリオンにただ1つのサブスクリプションを作成することにより、簡素化することを見出しました。

{ 
    "entities": [ 
     { 
      "type": "Room", 
      "isPattern": "true", 
      "id": "Room.*" 
     } 
    ] ... 

は、その後、私はシグナスにグループ化機能(http://fiware-cygnus.readthedocs.io/en/develop/installation_and_administration_guide/grouping_rules_conf/index.html)を気づいたが、シグナスは私のグループ化の設定ファイルをロードしたくないので、今、私は迷ってしまいました。これは、このエラーを示しています

cygnusagent.sources.http-source.interceptors.gi.gropuing_rules_conf_file = /usr/cygnus/conf/grouping_rules.conf 

そしてgrouping_rules.confで:私は私のエージェントの設定ファイルで

time=2016-05-03T05:32:29.658CDT | lvl=INFO | trans= | srv= | subsrv= | function=<init> | comp=Cygnus | msg=com.telefonica.iot.cygnus.interceptors.GroupingRules[58] : No grouping rules have been read 
Exception in thread "Thread-1" java.lang.NullPointerException 
    at java.io.File.<init>(File.java:277) 
    at com.telefonica.iot.cygnus.interceptors.GroupingInterceptor$ConfigurationReader.run(GroupingInterceptor.java:244) 

{ 
    "grouping_rules": [ 
     { 
      "id": 1, 
      "fields": [ 
       "entityId" 
      ], 
      "regex": "room.*", 
      "destination": "Rooms", 
      "fiware_service_path": "/myhouse" 
     } 
    ] 
} 

編集2:

Iドキュメントとしてすべての行を言った:

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 = test 
    cygnusagent.sources.http-source.handler.default_service_path = /myhouse 
    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 = /usr/cygnus/conf/grouping_rules.conf 
cygnusagent.channels.ckan-channel.type = memory 
cygnusagent.channels.ckan-channel.capacity = 1000 
cygnusagent.channels.ckan-channel.transactionCapacity = 100 

# ============================================ 
# 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 = 436fffc8-b397-478a-92fd-bbc5ffaf8269 

# 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 

ファイル権は私にはOKらしい:

[[email protected] conf]# ls *.conf -l 
-rwxrwxrwx 1 cygnus cygnus 2675 may 3 06:45 agent_test.conf 
-rwxrwxrwx 1 cygnus cygnus 258 may 3 05:08 grouping_rules.conf 
-rwxr-xr-x 1 cygnus cygnus 135 mar 1 02:50 krb5_login.conf 

テストはOK pases:私が使用

Results : 

Tests run: 80, Failures: 0, Errors: 0, Skipped: 0 

    [INFO] ------------------------------------------------------------------------ 
    [INFO] BUILD SUCCESS 
    [INFO] ------------------------------------------------------------------------ 
    [INFO] Total time: 1:05.862s 
    [INFO] Finished at: Tue May 03 06:53:44 CDT 2016 
    [INFO] Final Memory: 41M/105M 
    [INFO] ------------------------------------------------------------------------ 

起動コマンド:/usr/cygnus/bin/cygnus-flume-ng agent --conf /usr/cygnus/conf/ -f /usr/cygnus/conf/agent_test.conf -n cygnusagent -Dflume.root.logger=INFO,console

答えて

2

はい、あなたは正しいですグループ化ルールは、あなたが記述しているものとしてユースケースを達成するために設計されています。したがって、すべてのエンティティの型に一致する正規表現を持つ単純なルールを定義することによって(そのような型は常に同じであると仮定して)、そのトリックを行う必要があります。エンティティIDの共通部分に一致する正規表現を使用して(提案どおりに)行うことができます。

それでも、あなたの問題はグループ化ルールにあるようです。あなたの設定には次のものが含まれています:

cygnusagent.sources.http-source.interceptors.gi.gropuing_rules_conf_file = /usr/cygnus/conf/grouping_rules.conf 

あなたはこのようなことがある前にあなたが確認できますか?

cygnus-ngsi.sources.http-source.interceptors = ts gi 
cygnus-ngsi.sources.http-source.interceptors.ts.type = timestamp 
cygnus-ngsi.sources.http-source.interceptors.gi.type = com.telefonica.iot.cygnus.interceptors.GroupingInterceptor$Builder 

さらに、/usr/cygnus/conf/grouping_rules.confの権限をチェックすることはできますか? Cygnusを実行しているユーザーが読むことができない可能性があります。

ルールについては、新しいFIWAREサービスパスは/で始まる必要があります。これは、すべてのFIWAREサービスパスがスラッシュで始まる必要があるためです(これは前バージョンでは正しく記述されていないと思います)。

HTH!

EDIT 1

私は問題を発見したと思います。設定されたパラメータ名は "... gro p uing ..."ですが、正しいものは "...グループ化..."です。

+0

私は質問を編集しました。 /を追加してサービスパスを変更しました。問題は、理由を知らないままです。答えをありがとう。 –

+0

Cygnusのどのバージョンが稼働していますか?あなたはCygnusを実行したすべてのログでpastebinを追加できますか?私はプロセスの始めから書かれたトレースに興味があります。 – frb

+0

私はcygnusを使用しています0.13.0 pastebin-> http://pastebin.com/wGLz1NPV –

関連する問題