2015-07-17 2 views
1

С момента последнего обновления я не смог загрузить свои данные в Космос с помощью Cygnus. Я знаю, что теперь нам нужно использовать токен Oauth2. Поэтому я сделал запрос на токен.Oauth2 Cygnus и Cosmos Sink не работает

curl -k -X POST "https://cosmos.lab.fiware.org:13000/cosmos-auth/v1/token" -H "Content-Type: application/x-www-form-urlencoded" -d "grant_type=password&[email protected]&password=XXXXX" 

я получаю жетон, но затем я пытаюсь проверить маркер:

curl -X GET "http://cosmos.lab.fiware.org:14000/webhdfs/v1/guillaume.jourdain/hostabee?op=liststatus&[email protected]" -H "X-Auth-Token: TheToken" 

и даже это:

curl -X GET "http://cosmos.lab.fiware.org:14000/webhdfs/v1/guillaume.jourdain/hostabee?op=liststatus&user.name=guillaume.jourdain" -H "X-Auth-Token: TheToken" 

И Everytime, для каждого из этой команды и для всех токен I Пробовал я получил:

Пользовательский токен не авторизован

Далее я попытался поставить параметр OAuth в моем Cygnus файл конф и это происходило каждый раз:

2015-07-17 16:17:17,797 (lifecycleSupervisor-1-1) [INFO - es.tid.fiware.orionconnectors.cosmosinjector.hdfs.HttpFSBackend.createDir(HttpFSBackend.java:71)] HttpFS response: HTTP/1.1 401 Unauthorized 
2015-07-17 16:17:17,798 (lifecycleSupervisor-1-1) [ERROR - es.tid.fiware.orionconnectors.cosmosinjector.OrionHDFSSink.start(OrionHDFSSink.java:108)] The directory could not be created in HDFS. HttpFS response: 401 Unauthorized 

Так что да, на данный момент я вроде застрял. У вас есть информация для меня, чтобы решить эту проблему?

EDIT:

Вот мой файл конфигурации Cygnus, может быть, проблема здесь находится

APACHE_FLUME_HOME/conf/cygnus.conf 
orionagent.sources = http-source 
orionagent.sinks = hdfs-sink 
orionagent.channels = notifications 

# Flume source, must not be changed 
orionagent.sources.http-source.type = org.apache.flume.source.http.HTTPSource 
# channel name where to write the notification events 
orionagent.sources.http-source.channels = notifications 
# listening port the Flume source will use for receiving incoming notifications 
orionagent.sources.http-source.port = 5050 
# Flume handler that will parse the notifications, must not be changed 
orionagent.sources.http-source.handler = com.telefonica.iot.cygnus.handlers.OrionRestHandler 
# regular expression for the orion version the notifications will have in their headers 
orionagent.sources.http-source.handler.orion_version = 0\.23\.* 
# URL target 
orionagent.sources.http-source.handler.notification_target = /notify 

# channel name from where to read notification events 
orionagent.sinks.hdfs-sink.channel = notifications 
# Flume sink that will process and persist in HDFS the notification events, must not be changed 
orionagent.sinks.hdfs-sink.type = com.telefonica.iot.cygnus.sinks.OrionHDFSSink 
# IP address of the Cosmos deployment where the notification events will be persisted 
orionagent.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 
orionagent.sinks.hdfs-sink.cosmos_port = 14000 
# username allowed to write in HDFS (/user/myusername) 
orionagent.sinks.hdfs-sink.cosmos_username = guillaume.jourdain 
# dataset where to persist the data (/user/myusername/mydataset) 

orionagent.sinks.hdfs-sink.cosmos_password = XXXXX 
orionagent.sinks.hdfs-sink.cosmos_dataset = hostABee 
orionagent.sinks.hdfs-sink.attr_persistence = column 

orionagent.sinks.hdfs-sink.hive_host = 130.206.80.46 
orionagent.sinks.hdfs-sink.hive_port = 10000 
orionagent.sinks.hdfs-sink.oauth2_token = TheTOKEN 


# HDFS backend type (webhdfs, httpfs or infinity) 
orionagent.sinks.hdfs-sink.hdfs_api = webhdfs 

# channel name 
orionagent.channels.notifications.type = memory 
# capacity of the channel 
orionagent.channels.notifications.capacity = 1000 
# amount of bytes that can be sent per transaction 
orionagent.channels.notifications.transactionCapacity = 100 

Теперь я получаю эту ошибку (и другие). Раковина и обработчики не найдены

2015-07-27 14:27:10,562 (conf-file-poller-0) [INFO - org.apache.flume.sink.DefaultSinkFactory.create(DefaultSinkFactory.java:40)] Creating instance of sink: hdfs-sink, type: com.telefonica.iot.cygnus.sinks.OrionHDFSSink 
2015-07-27 14:27:10,562 (conf-file-poller-0) [ERROR - org.apache.flume.node.PollingPropertiesFileConfigurationProvider$FileWatcherRunnable.run(PollingPropertiesFileConfigurationProvider.java:142)] Failed to load configuration data. Exception follows. 
org.apache.flume.FlumeException: Unable to load sink type: com.telefonica.iot.cygnus.sinks.OrionHDFSSink, class: com.telefonica.iot.cygnus.sinks.OrionHDFSSink 
    at org.apache.flume.sink.DefaultSinkFactory.getClass(DefaultSinkFactory.java:69) 
    at org.apache.flume.sink.DefaultSinkFactory.create(DefaultSinkFactory.java:41) 
    at org.apache.flume.node.AbstractConfigurationProvider.loadSinks(AbstractConfigurationProvider.java:415) 
    at org.apache.flume.node.AbstractConfigurationProvider.getConfiguration(AbstractConfigurationProvider.java:103) 
    at org.apache.flume.node.PollingPropertiesFileConfigurationProvider$FileWatcherRunnable.run(PollingPropertiesFileConfigurationProvider.java:140) 
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) 
    at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351) 
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178) 
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:165) 
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:267) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 
    at java.lang.Thread.run(Thread.java:701) 
Caused by: java.lang.ClassNotFoundException: com.telefonica.iot.cygnus.sinks.OrionHDFSSink 
    at java.net.URLClassLoader$1.run(URLClassLoader.java:217) 
    at java.security.AccessController.doPrivileged(Native Method) 
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205) 
    at java.lang.ClassLoader.loadClass(ClassLoader.java:323) 
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) 
    at java.lang.ClassLoader.loadClass(ClassLoader.java:268) 
    at java.lang.Class.forName0(Native Method) 
    at java.lang.Class.forName(Class.java:190) 
    at org.apache.flume.sink.DefaultSinkFactory.getClass(DefaultSinkFactory.java:67) 
    ... 12 more 

Спасибо, что прочитали.

ответ

0

Что касается WebHDFS команды для включения в папку HDFS:

curl -X GET "http://cosmos.lab.fiware.org:14000/webhdfs/v1/guillaume.jourdain/hostabee?op=liststatus&[email protected]" -H "X-Auth-Token: TheToken" 

user.name должен быть user.name=guillaume.jourdain (без @4planet.eu части).

Что касается Лебедя, обновили ли вы до 0,8? Это единственная версия Cygnus, поддерживающая OAuth2. Я думаю, вы не обновлялись из-за журналов es.tid.fiware.orionconnectors.cosmosinjector.OrionHDFSSink (эти пакеты были выше 0.8.0). У вас есть все подробности для обновления here.

+0

Еще раз. Мой cygnus был на хорошей версии, когда я пытался. Возможно, проблема возникла из моего файла конфигурации. Я редактирую свой пост, чтобы вы могли увидеть, есть ли с ним какие-либо проблемы. –