Since it was announced the access to Cosmos' WebHDFS in FIWARE Lab is protected with OAuth2, Cygnus (version 0.8.1) is not able to persist Orion's context data in Cosmos HDFS:
15/07/09 08:45:21 INFO handlers.OrionRestHandler: Starting transaction (1436424291-649-0000000000)
15/07/09 08:45:21 INFO handlers.OrionRestHandler: Received data ({ "subscriptionId" : "51c0ac9ed714fb3b37d7d5a8", "originator" : "localhost", "contextResponses" : [ { "contextElement" : { "attributes" : [ { "name" : "temperature", "type" : "centigrade", "value" : "26.5" } ], "type" : "Room", "isPattern" : "false", "id" : "Room1" }, "statusCode" : { "code" : "200", "reasonPhrase" : "OK" } } ]})
15/07/09 08:45:21 INFO handlers.OrionRestHandler: Event put in the channel (id=109760451, ttl=10)
15/07/09 08:45:21 INFO sinks.OrionSink: Event got from the channel (id=109760451, headers={timestamp=1436424321536, content-type=application/json, transactionId=1436424291-649-0000000000, fiware-service=def_serv, fiware-servicepath=def_serv_path, ttl=10, destination=room1_room}, bodyLength=460)
15/07/09 08:45:22 INFO sinks.OrionHDFSSink: [hdfs-sink] Persisting data at OrionHDFSSink. HDFS file (def_serv/def_serv_path/room1_room/room1_room.txt), Data ({"recvTime":"2015-07-09T06:45:21.536Z","temperature":"26.5", "temperature_md":[]})
15/07/09 08:45:22 ERROR sinks.OrionSink: Persistence error (The /user/frb/def_serv/def_serv_path/room1_room directory could not be created in HDFS. HttpFS response: 503 Service unavailable)
15/07/09 08:45:22 INFO sinks.OrionSink: An event was put again in the channel (id=109760451, ttl=9)
15/07/09 08:45:22 INFO sinks.OrionSink: Finishing transaction (1436424291-649-0000000000)
I figure out an OAuth2 token has to be configured somewhere, but how?
IMPORTANT: Before implementing any of the commands below, backup your Cygnus configurations since they will be still valid with minor changes.
Sadly, available Cygnus versions have no support for OAuth2. Until now. You will have to upgrade to the latest 0.8.2, which allows to configure a token through this OrionHDFSSink parameter:
Upgrading to Cygnus 0.8.2 is as easy as installing it from the FIWARE repo:
Remember the FIWARE repo is setup by editing
/etc/yum.repos.d/fiware.repo
(most probably you already have it):In the example below, we are moving from a 0.7.0 version to latest 0.8.2:
In order to check you have the right version, you can do several things. For instance, using the
rpm
command:Or using the
yum list
:Or simply check the
oauth2_token
parameter is there ;)IMPORTANT: Backup your Cygnus configurations since they will be still valid with minor changes:
es.tid.fiware.fiwareconnectors.cygnus.etc
butcom.telefonica.iot.cygus.etc
.matching_table.conf
(CSV-like content) now is named asgrouping_rules.conf
(JSON-like content with the same semantic than the CSV-like version).