пустое имя присваивается как папке, так и файлу при передаче данных из Ориона в Космос с использованием Cygnus

У меня проблема, связанная с потоком данных ngsi2cosmos. Все работает нормально при сохранении информации, полученной в Orion, в общедоступном экземпляре Cosmos, но папка назначения и имя файла имеют значение «null».

Простой тест следующим образом:

  • Я создаю новый NGSIEntity с добавленными заголовками: Fiware-Service: myservice & Fiware-ServicePath: / my
  • Я добавляю новую подписку с Cygnus в качестве эталонной конечной точки.
  • Отправляю обновление в ранее созданный NGSIEntity

Когда я проверяю свое пользовательское пространство в Cosmos, я проверяю, что был создан следующий маршрут: /user/myuser/myservice/null/null.txt

С содержимым файла все в порядке, каждая обновленная информация в Орионе была правильно вмонтирована в него. Проблема с именами папок и файлов. Я не могу заставить его работать должным образом. Разве не предполагается получение entityId и entityType для именования папок и файлов?

Версии компонентов:

  • Версия Ориона: contextBroker-0.19.0-1.x86_64
  • Версия Cygnus: cygnus-0.5-91.g3eb100e.x86_64
  • Космос: глобальный экземпляр

Файл конфигурации Cygnus:

cygnusagent.sources = http-source
cygnusagent.sinks = hdfs-sink 
cygnusagent.channels = hdfs-channel

#=============================================
# source configuration
# channel name where to write the notification events
cygnusagent.sources.http-source.channels = hdfs-channel
# source class, must not be changed
cygnusagent.sources.http-source.type = org.apache.flume.source.http.HTTPSource
# listening port the Flume source will use for receiving incoming notifications
cygnusagent.sources.http-source.port = 5050
# Flume handler that will parse the notifications, must not be changed
cygnusagent.sources.http-source.handler = es.tid.fiware.fiwareconnectors.cygnus.handlers.OrionRestHandler
# URL target
cygnusagent.sources.http-source.handler.notification_target = /notify
# Default organization (organization semantic depend on the persistence sink)
cygnusagent.sources.http-source.handler.default_organization = org42
# Number of channel re-injection retries before a Flume event is definitely discarded
cygnusagent.sources.http-source.handler.events_ttl = 10
# Management interface port (FIXME: temporal location for this parameter)
cygnusagent.sources.http-source.handler.management_port = 8081
# Source interceptors, do not change
cygnusagent.sources.http-source.interceptors = ts
# Timestamp interceptor, do not change
cygnusagent.sources.http-source.interceptors.ts.type = timestamp
# Destination extractor interceptor, do not change
cygnusagent.sources.http-source.interceptors.de.type = es.tid.fiware.fiwreconnectors.cygnus.interceptors.DestinationExtractor$Builder
# Matching table for the destination extractor interceptor, do not change
cygnusagent.sources.http-source.interceptors.de.matching_table = matching_table.conf

# ============================================
# OrionHDFSSink configuration
# channel name from where to read notification events
cygnusagent.sinks.hdfs-sink.channel = hdfs-channel
# sink class, must not be changed
cygnusagent.sinks.hdfs-sink.type = es.tid.fiware.fiwareconnectors.cygnus.sinks.OrionHDFSSink
# Comma-separated list of FQDN/IP address regarding the Cosmos Namenode endpoints
cygnusagent.sinks.hdfs-sink.cosmos_host = 130.206.80.46
# port of the Cosmos service listening for persistence operations; 14000 for httpfs, 50070 for webhdfs and free choice for inifinty
cygnusagent.sinks.hdfs-sink.cosmos_port = 14000
# default username allowed to write in HDFS
cygnusagent.sinks.hdfs-sink.cosmos_default_username = myuser
# default password for the default username
cygnusagent.sinks.hdfs-sink.cosmos_default_password = mypassword
# HDFS backend type (webhdfs, httpfs or infinity)
cygnusagent.sinks.hdfs-sink.hdfs_api = httpfs
# how the attributes are stored, either per row either per column (row, column)
cygnusagent.sinks.hdfs-sink.attr_persistence = column
# prefix for the database and table names, empty if no prefix is desired
cygnusagent.sinks.hdfs-sink.naming_prefix =
# Hive FQDN/IP address of the Hive server
cygnusagent.sinks.hdfs-sink.hive_host = 130.206.80.46
# Hive port for Hive external table provisioning
cygnusagent.sinks.hdfs-sink.hive_port = 10000

#=============================================
# hdfs-channel configuration
# channel type (must not be changed)
cygnusagent.channels.hdfs-channel.type = memory
# capacity of the channel
cygnusagent.channels.hdfs-channel.capacity = 1000
# amount of bytes that can be sent per transaction
cygnusagent.channels.hdfs-channel.transactionCapacity = 100

person arkabide    schedule 08.07.2015    source источник
comment
Не могли бы вы отредактировать свой вопрос, добавив соответствующие логи? (если они большие, попробуйте использовать Github gist gist.github.com). Мне бы они понадобились, чтобы понять, что происходит.   -  person frb    schedule 08.07.2015


Ответы (1)


Я думаю, вам следует настроить match_table cygnus для определения пути и имени файла.

Этот файл находится по тому же пути, что и файл конфигурации Cygnus agent.

Вы можете следовать следующему примеру:

# integer id|comma-separated fields|regex to be applied to the fields concatenation|destination|dataset
#
# The available "dictionary" of fields is:
#  - entitydId
#  - entityType
#  - servicePath

1|entityId,entityType|Room\.(\d*)Room|numeric_rooms|rooms
person Jon Mikel Alonso    schedule 08.07.2015
comment
Собственно, это могло быть одной из причин. Я бы посоветовал проверить наличие /usr/cygnus/conf/matching_table.conf (не шаблона, а его экземпляра) и попытаться удалить / прокомментировать любой пример правила, который может существовать. - person frb; 08.07.2015
comment
Спасибо за ответы. Файл отсутствовал, и его пришлось создать вручную, но он не работал (я сделал это перед тем, как опубликовать этот вопрос). Я попытался обновить cygnus, но процесс обновления также не работает должным образом, так как каталог / usr / cygnus был удален в процессе (к счастью, я сначала сделал резервную копию). Я попробую новый экземпляр и установлю orion и cygnus вручную, поскольку я проверил, что версии orion и cygnus в orion-psb-image-R4.2 устарели, и это также может быть причиной ошибки . - person arkabide; 10.07.2015
comment
Да, до Cygnus 0.6.0 в RPM была ошибка, из-за которой обновление можно было избежать, просто выполнив yum instal cygnus. Я рекомендую вам прочитать этот вопрос: stackoverflow.com/questions / 31310111 / oauth2-in-cygnus /. Там вы узнаете, как перейти на Cygnus 0.8.2, а также как выполнить аутентификацию / авторизацию через OAuth2. - person frb; 14.07.2015