Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-4330

FIWARE.Question.Tech.Data.BigData-Analysis.Oauth2 Cygnus and Cosmos Sink doesn't seems to work

    Details

      Description

      Created question in FIWARE Q/A platform on 17-07-2015 at 16:07
      Please, ANSWER this question AT http://stackoverflow.com/questions/31478049/oauth2-cygnus-and-cosmos-sink-doesnt-seems-to-work

      Question:
      Oauth2 Cygnus and Cosmos Sink doesn't seems to work

      Description:
      Since the last update , i haven't been able to upload my data to Cosmos using Cygnus . I am aware that we now need to use Oauth2 token to do it . So i did the request for the token .

      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&username=guillaume.jourdain@4planet.eu&password=XXXXX"

      I get a token, but then i try to check the token :

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

      and even this :

      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"

      And Everytime , for each of this command and for all the token I Tried i get this :

      User token not authorized

      Next i tried to put the oauth parameter in my cygnus conf file and this occured everytime :

      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

      So yeah , for the moment i'm kinda stuck . Do you have any information for me to resolve this problem ?

      EDIT :

      Here's my Cygnus Configuration file , maybe the problem is located here

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

      1. Flume source, must not be changed
        orionagent.sources.http-source.type = org.apache.flume.source.http.HTTPSource
      2. channel name where to write the notification events
        orionagent.sources.http-source.channels = notifications
      3. listening port the Flume source will use for receiving incoming notifications
        orionagent.sources.http-source.port = 5050
      4. Flume handler that will parse the notifications, must not be changed
        orionagent.sources.http-source.handler = com.telefonica.iot.cygnus.handlers.OrionRestHandler
      5. regular expression for the orion version the notifications will have in their headers
        orionagent.sources.http-source.handler.orion_version = 0\.23\.*
      6. URL target
        orionagent.sources.http-source.handler.notification_target = /notify
      1. channel name from where to read notification events
        orionagent.sinks.hdfs-sink.channel = notifications
      2. 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
      3. IP address of the Cosmos deployment where the notification events will be persisted
        orionagent.sinks.hdfs-sink.cosmos_host = 130.206.80.46
      4. 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
      5. username allowed to write in HDFS (/user/myusername)
        orionagent.sinks.hdfs-sink.cosmos_username = guillaume.jourdain
      6. 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

      1. HDFS backend type (webhdfs, httpfs or infinity)
        orionagent.sinks.hdfs-sink.hdfs_api = webhdfs
      1. channel name
        orionagent.channels.notifications.type = memory
      2. capacity of the channel
        orionagent.channels.notifications.capacity = 1000
      3. amount of bytes that can be sent per transaction
        orionagent.channels.notifications.transactionCapacity = 100

      Now I get this error (and others). The sink and the handlers does'nt seems to be found

      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

      Thank you for reading .

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            frb Francisco Romero
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: