1

I've been following this procedure to install Cygnus as a service (https://github.com/telefonicaid/fiware-cygnus/tree/master/cygnus-ngsi), but when running it the below error pop up:

● cygnus.service - SYSV: cygnus

   Loaded: loaded (/etc/rc.d/init.d/cygnus; bad; vendor preset: disabled)

   Active: failed (Result: exit-code) since Tue 2017-01-17 18:27:15 UTC; 8s ago

     Docs: man:systemd-sysv-generator(8)

  Process: 8260 ExecStart=/etc/rc.d/init.d/cygnus start (code=exited, status=1/FAILURE)


Jan 17 18:27:15 servername systemd[1]: Starting SYSV: cygnus...

Jan 17 18:27:15 servername systemd[1]: cygnus.service: control process exited, code=exited status=1

Jan 17 18:27:15 servername systemd[1]: Failed to start SYSV: cygnus.

Jan 17 18:27:15 servername systemd[1]: Unit cygnus.service entered failed state.

Jan 17 18:27:15 servername systemd[1]: cygnus.service failed.

Jan 17 18:27:15 servername cygnus[8260]: There aren't any instance of Cygnus configured. Refer to file /usr/cygnus/conf/README.md ...mation.


Hint: Some lines were ellipsized, use -l to show in full

I have already tried two mechanism to solve the issue without success:

  1. Giving full permit to /var/run/cygnus directory; as suggested here Fiware: can not start cygnus as service.

In my case, it does run as standalone application (not as a service) by using:

`/usr/cygnus/bin/cygnus-flume-ng agent --conf /usr/cygnus/conf/ -f /usr/cygnus/conf/agent.conf -n cygnusagent -Dflume.root.logger=INFO,console`
  1. Changing owner permission as suggested here: unable to start Fiware Cygnus as a service

Complementary information:

When I run a stat tool:

curl -X GET "http://localhost:8081/v1/stats" | python -m json.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    67  100    67    0     0   3983      0 --:--:-- --:--:-- --:--:--  4187
{
    "stats": {
        "channels": [],
        "sinks": [],
        "sources": []
    },
    "success": "true"
}

Files I'm using:

agent.conf

cygnus-ngsi.sources = http-source
cygnus-ngsi.sinks = hdfs-sink
cygnus-ngsi.channels = hdfs-channel

cygnus-ngsi.sources.http-source.type = org.apache.flume.source.http.HTTPSource
cygnus-ngsi.sources.http-source.channels = hdfs-channel
cygnus-ngsi.sources.http-source.port = 5050
cygnus-ngsi.sources.http-source.handler = com.telefonica.iot.cygnus.handlers.NGSIRestHandler
cygnus-ngsi.sources.http-source.handler.notification_target = /notify
cygnus-ngsi.sources.http-source.handler.default_service = default
cygnus-ngsi.sources.http-source.handler.default_service_path = /
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.NGSIGroupingInterceptor$Builder
cygnus-ngsi.sources.http-source.interceptors.gi.grouping_rules_conf_file = /usr/cygnus/conf/grouping_rules.conf #/opt/apache-flume/conf/grouping_rules.conf

cygnus-ngsi.sinks.hdfs-sink.type = com.telefonica.iot.cygnus.sinks.NGSIHDFSSink
cygnus-ngsi.sinks.hdfs-sink.channel = hdfs-channel
cygnus-ngsi.sinks.hdfs-sink.hdfs_host = iot-hdfs
cygnus-ngsi.sinks.hdfs-sink.hdfs_port = 14000
cygnus-ngsi.sinks.hdfs-sink.hdfs_username = <USERNAME>
cygnus-ngsi.sinks.hdfs-sink.oauth2_token = <TOKEN>


cygnus-ngsi.channels.hdfs-channel.type = com.telefonica.iot.cygnus.channels.CygnusMemoryChannel
cygnus-ngsi.channels.hdfs-channel.capacity = 1000
cygnus-ngsi.channels.hdfs-channel.transactionCapacity = 100

cygnus_instance.conf

CYGNUS_USER=cygnus

# Where is the config folder
CONFIG_FOLDER=/usr/cygnus/conf

# Which is the config file
CONFIG_FILE=/usr/cygnus/conf/agent.conf

# Name of the agent. The name of the agent is not trivial, since it is the base for the Flume parameters
# naming conventions, e.g. it appears in .sources.http-source.channels=...
AGENT_NAME=cygnusagent

# Name of the logfile located at /var/log/cygnus. It is important to put the extension '.log' in order to the log rotation works properly
LOGFILE_NAME=cygnus.log

# Administration port. Must be unique per instance
ADMIN_PORT=8081

# Polling interval (seconds) for the configuration reloading
POLLING_INTERVAL=30

Any hint to work this out?

Community
  • 1
  • 1
netzahdzc
  • 237
  • 1
  • 10

1 Answers1

0

As you can see in the logs when starting the service:

Jan 17 18:27:15 servername cygnus[8260]: There aren't any instance of Cygnus configured. Refer to file /usr/cygnus/conf/README.md ...mation.

When running Cygnus as a service, two files must be given, the agent one and the instance one. You already configured them, so that's OK, but an important thing is missing: both file names must include an ID string. For instance, they could be named as agent_1.conf and cygnus_instance_1.conf (the "1" string is the ID of the instance).

This is explained here. Nevertheless, we'll try to improve the documentation in order to make it clearer.

frb
  • 3,738
  • 2
  • 21
  • 51