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

[fiware-stackoverflow] unable to start Fiware Cygnus as a service

    Details

      Description

      Created question in FIWARE Q/A platform on 03-08-2015 at 12:08
      Please, ANSWER this question AT https://stackoverflow.com/questions/31785076/unable-to-start-fiware-cygnus-as-a-service

      Question:
      unable to start Fiware Cygnus as a service

      Description:
      I installed fiware cygnus using RPM on my centOS 7 but I can't start it as service. I got the following error:

      [root@localhost cygnus]# sudo service cygnus start
      Starting cygnus (via systemctl): Job for cygnus.service failed. See 'systemctl status cygnus.service' and 'journalctl -xn' for details.
      [ÉCHOUÉ]
      [root@localhost cygnus]# systemctl status cygnus.service -l
      cygnus.service - SYSV: cygnus
      Loaded: loaded (/etc/rc.d/init.d/cygnus)
      Active: failed (Result: exit-code) since ven. 2015-07-31 19:11:10 CEST; 2s ago
      Process: 5750 ExecStart=/etc/rc.d/init.d/cygnus start (code=exited, status=1/FAILURE)

      juil. 31 19:11:08 localhost cygnus[5750]: /usr/cygnus/conf/cygnus_instance_1.conf: ligne34: mongo-channel : commande introuvable
      juil. 31 19:11:08 localhost su[5756]: (to root) root on none
      juil. 31 19:11:10 localhost cygnus[5750]: Starting Cygnus 1... [ÉCHOUÉ]
      juil. 31 19:11:10 localhost systemd[1]: cygnus.service: control process exited, code=exited status=1
      juil. 31 19:11:10 localhost systemd[1]: Failed to start SYSV: cygnus.
      juil. 31 19:11:10 localhost systemd[1]: Unit cygnus.service entered failed state.

      not sure what to put as name of the agent in the configuration file: cygnus_instance_1.conf since it did not reconize the agent name

      1. Name of the agent. The name of the agent is not trivial, since it is the base for the Fluleters
      2. naming conventions, e.g. it appears in .sources.http-source.channels=...
        AGENT_NAME= mongo-channel

      Here is my complete configuration files:
      cygnus_instance_1.conf

      #####
      #

      1. Configuration file for apache-flume
        #
        #####
      2. Copyright 2014 Telefonica Investigación y Desarrollo, S.A.U
      3. This file is part of fiware-cygnus (FI-WARE project).
      4. fiware-cygnus is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
      5. Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
      6. later version.
      7. fiware-cygnus is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
      8. warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
      9. details.
      10. You should have received a copy of the GNU Affero General Public License along with fiware-cygnus. If not, see
      11. http://www.gnu.org/licenses/.
      12. For those usages not covered by the GNU Affero General Public License please contact with iot_support at tid dot es
      1. Who to run cygnus as. Note that you may need to use root if you want
      2. to run cygnus in a privileged port (<1024)
        CYGNUS_USER=root
      1. Where is the config folder
        CONFIG_FOLDER=/usr/cygnus/conf
      1. Which is the config file
        CONFIG_FILE=/usr/cygnus/conf/agent_1.conf
      1. Name of the agent. The name of the agent is not trivial, since it is the base for the Fluleters
      2. naming conventions, e.g. it appears in .sources.http-source.channels=...
        AGENT_NAME= /usr/cygnus/bin/cygnus-flume-ng
        #mongo-channel
      1. 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
      1. Administration port. Must be unique per instance
        ADMIN_PORT=8081
      1. Polling interval (seconds) for the configuration reloading
        POLLING_INTERVAL=30

      agent_1.conf

      1. Copyright 2014 Telefónica Investigación y Desarrollo, S.A.U
      2. This file is part of fiware-cygnus (FI-WARE project).
      3. fiware-cygnus is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
      4. Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
      5. later version.
      6. fiware-cygnus is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
      7. warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
      8. details.
      9. You should have received a copy of the GNU Affero General Public License along with fiware-cygnus. If not, see
      10. http://www.gnu.org/licenses/.
      11. For those usages not covered by the GNU Affero General Public License please contact with iot_support at tid dot es

      #=============================================

      1. To be put in APACHE_FLUME_HOME/conf/agent.conf
        #
      2. General configuration template explaining how to setup a sink of each of the available types (HDFS, CKAN, MySQL).

      #=============================================

      1. The next tree fields set the sources, sinks and channels used by Cygnus. You could use different names than the
      2. ones suggested below, but in that case make sure you keep coherence in properties names along the configuration file.
      3. Regarding sinks, you can use multiple types at the same time; the only requirement is to provide a channel for each
      4. one of them (this example shows how to configure 3 sink types at the same time). Even, you can define more than one
      5. sink of the same type and sharing the channel in order to improve the performance (this is like having
      6. multi-threading).
        cygnusagent.sources = http-source
        cygnusagent.sinks = mongo-sink
        cygnusagent.channels = mongo-channel

      #=============================================

      1. source configuration
      2. channel name where to write the notification events
        cygnusagent.sources.http-source.channels = mongo-channel
      3. source class, must not be changed
        cygnusagent.sources.http-source.type = org.apache.flume.source.http.HTTPSource
      4. listening port the Flume source will use for receiving incoming notifications
        cygnusagent.sources.http-source.port = 5050
      5. Flume handler that will parse the notifications, must not be changed
        cygnusagent.sources.http-source.handler = com.telefonica.iot.cygnus.handlers.OrionRestHandler
      6. URL target
        cygnusagent.sources.http-source.handler.notification_target = /notify
      7. Default service (service semantic depends on the persistence sink)
        cygnusagent.sources.http-source.handler.default_service = def_serv
      8. Default service path (service path semantic depends on the persistence sink)
        cygnusagent.sources.http-source.handler.default_service_path = def_servpath
      9. Number of channel re-injection retries before a Flume event is definitely discarded (-1 means infinite retries)
        cygnusagent.sources.http-source.handler.events_ttl = 10
      10. Source interceptors, do not change
        cygnusagent.sources.http-source.interceptors = ts gi
      11. TimestampInterceptor, do not change
        cygnusagent.sources.http-source.interceptors.ts.type = timestamp
      12. GroupinInterceptor, do not change
        cygnusagent.sources.http-source.interceptors.gi.type = com.telefonica.iot.cygnus.interceptors.GroupingInterceptor$Builder
      13. Grouping rules for the GroupingInterceptor, put the right absolute path to the file if necessary
      14. See the doc/design/interceptors document for more details
        cygnusagent.sources.http-source.interceptors.gi.grouping_rules_conf_file = /usr/cygnus/conf/grouping_rules.conf
      1. ============================================
      2. OrionMongoSink configuration
      3. sink class, must not be changed
        cygnusagent.sinks.mongo-sink.type = com.telefonica.iot.cygnus.sinks.OrionMongoSink
      4. channel name from where to read notification events
        cygnusagent.sinks.mongo-sink.channel = mongo-channel
      5. FQDN/IP:port where the MongoDB server runs (standalone case) or comma-separated list of FQDN/IP:port pairs where the MongoDB replica set members run
        cygnusagent.sinks.mongo-sink.mongo_hosts = 192.168.1.40:27017
      6. a valid user in the MongoDB server (or empty if authentication is not enabled in MongoDB)
        #cygnusagent.sinks.mongo-sink.mongo_username = mongo_username
      7. password for the user above (or empty if authentication is not enabled in MongoDB)
        #cygnusagent.sinks.mongo-sink.mongo_password = xxxxxxxx
      8. prefix for the MongoDB databases
        #cygnusagent.sinks.mongo-sink.db_prefix = sth_
      9. prefix pro the MongoDB collections
        #cygnusagent.sinks.mongo-sink.collection_prefix = sth_
      10. true is collection names are based on a hash, false for human redable collections
        cygnusagent.sinks.mongo-sink.should_hash = false

      #=============================================

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

      UPDATES after @frb response:
      I updated my cygnus_instance_1.conf @frb response but unfortuantly as I got the following error:

      systemctl status cygnus.service -l
      cygnus.service - SYSV: cygnus
      Loaded: loaded (/etc/rc.d/init.d/cygnus)
      Active: failed (Result: exit-code) since mer. 2015-08-05 17:22:09 CEST; 3s ago
      Process: 3338 ExecStart=/etc/rc.d/init.d/cygnus start (code=exited, status=1/FAILURE)

      août 05 17:22:07 localhost cygnus[3338]: /usr/cygnus/conf/cygnus_instance_1.conf: ligne24: cygnus : commande introuvable
      août 05 17:22:07 localhost cygnus[3338]: /usr/cygnus/conf/cygnus_instance_1.conf: ligne34: cygnusagent : commande introuvable
      août 05 17:22:07 localhost su[3345]: (to cygnus) root on none
      août 05 17:22:07 localhost cygnus[3338]: Starting Cygnus 1... bash: /var/run/cygnus/cygnus_1.pid: Permission non accordée
      août 05 17:22:09 localhost cygnus[3338]: cat: /var/run/cygnus/cygnus_1.pid: Aucun fichier ou dossier de ce type
      août 05 17:22:09 localhost cygnus[3338]: [ÉCHOUÉ]
      août 05 17:22:09 localhost cygnus[3338]: rm: impossible de supprimer « /var/run/cygnus/cygnus_1.pid »: Aucun fichier ou dossier de ce type
      août 05 17:22:09 localhost systemd[1]: cygnus.service: control process exited, code=exited status=1
      août 05 17:22:09 localhost systemd[1]: Failed to start SYSV: cygnus.
      août 05 17:22:09 localhost systemd[1]: Unit cygnus.service entered failed state.

      Looking to the above error I saw that it can't find the file "/var/run/cygnus/cygnus_1.pid" so I created an empty file to bypass this error but I got a new one:

      [root@localhost ~]# sudo systemctl start cygnus.service
      Job for cygnus.service failed. See 'systemctl status cygnus.service' and 'journalctl -xn' for details.
      [root@localhost ~]# sudo systemctl status cygnus.service -l
      cygnus.service - SYSV: cygnus
      Loaded: loaded (/etc/rc.d/init.d/cygnus)
      Active: failed (Result: exit-code) since mer. 2015-08-05 17:24:08 CEST; 5s ago
      Process: 3445 ExecStart=/etc/rc.d/init.d/cygnus start (code=exited, status=1/FAILURE)

      août 05 17:24:06 localhost systemd[1]: Starting SYSV: cygnus...
      août 05 17:24:06 localhost cygnus[3445]: /usr/cygnus/conf/cygnus_instance_1.conf: ligne24: cygnus : commande introuvable
      août 05 17:24:06 localhost cygnus[3445]: /usr/cygnus/conf/cygnus_instance_1.conf: ligne34: cygnusagent : commande introuvable
      août 05 17:24:06 localhost su[3452]: (to cygnus) root on none
      août 05 17:24:06 localhost cygnus[3445]: Starting Cygnus 1... bash: /var/run/cygnus/cygnus_1.pid: Permission non accordée
      août 05 17:24:08 localhost cygnus[3445]: [ÉCHOUÉ]
      août 05 17:24:08 localhost systemd[1]: cygnus.service: control process exited, code=exited status=1
      août 05 17:24:08 localhost systemd[1]: Failed to start SYSV: cygnus.
      août 05 17:24:08 localhost systemd[1]: Unit cygnus.service entered failed state.

        Activity

        Hide
        backlogmanager Backlog Manager added a comment -

        2017-05-23 12:05|CREATED monitor | # answers= 1, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2017-05-23 12:05|CREATED monitor | # answers= 1, accepted answer= False
        Hide
        backlogmanager Backlog Manager added a comment -

        2017-05-23 15:05|UPDATED status: transition Answer| # answers= 1, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2017-05-23 15:05|UPDATED status: transition Answer| # answers= 1, accepted answer= False
        Hide
        backlogmanager Backlog Manager added a comment -

        2017-05-23 18:05|UPDATED status: transition Answered| # answers= 1, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2017-05-23 18:05|UPDATED status: transition Answered| # answers= 1, accepted answer= False

          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: