Cygnus 未正确启动

Cygnus not correctly starting

您好,我遵循了 cygnus(http://fiware-cygnus.readthedocs.io/en/1.2.2/cygnus-ngsi/quick_start_guide/) 的快速入门指南,但我无法使其正常工作。 按照指南所述启动服务后,出现以下错误:

+ exec /opt/jdk1.8.0_151//bin/java -Xmx20m -Dflume.root.logger=INFO,console -cp '/usr/cygnus/conf:/usr/cygnus/lib/*:/usr/cygnus/plugins.d/cygnus/lib/*:/usr/cygnus/plugins.d/cygnus/libext/*' -Djava.library.path= com.telefonica.iot.cygnus.nodes.CygnusApplication -f /usr/cygnus/conf/agent_test.conf -n cygnusagent
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/cygnus/lib/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/cygnus/plugins.d/cygnus/lib/cygnus-0.13.0-jar-with-dependencies.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
time=2018-03-01T14:21:45.346CET | lvl=INFO | trans= | srv= | subsrv= | function=main | comp=Cygnus | msg=com.telefonica.iot.cygnus.nodes.CygnusApplication[248] : Starting Cygnus application
time=2018-03-01T14:21:45.351CET | lvl=INFO | trans= | srv= | subsrv= | function=main | comp=Cygnus | msg=com.telefonica.iot.cygnus.nodes.CygnusApplication[254] : Waiting for valid Flume components references...
time=2018-03-01T14:21:45.352CET | lvl=INFO | trans= | srv= | subsrv= | function=start | comp=Cygnus | msg=org.apache.flume.node.PollingPropertiesFileConfigurationProvider[61] : Configuration provider starting
time=2018-03-01T14:21:45.356CET | lvl=INFO | trans= | srv= | subsrv= | function=run | comp=Cygnus | msg=org.apache.flume.node.PollingPropertiesFileConfigurationProvider$FileWatcherRunnable[133] : Reloading configuration file:/usr/cygnus/conf/agent_test.conf
time=2018-03-01T14:21:45.363CET | lvl=INFO | trans= | srv= | subsrv= | function=addProperty | comp=Cygnus | msg=org.apache.flume.conf.FlumeConfiguration$AgentConfiguration[1016] : Processing:test-sink
time=2018-03-01T14:21:45.363CET | lvl=INFO | trans= | srv= | subsrv= | function=addProperty | comp=Cygnus | msg=org.apache.flume.conf.FlumeConfiguration$AgentConfiguration[1016] : Processing:test_sink
time=2018-03-01T14:21:45.363CET | lvl=INFO | trans= | srv= | subsrv= | function=addProperty | comp=Cygnus | msg=org.apache.flume.conf.FlumeConfiguration$AgentConfiguration[1016] : Processing:test-sink
time=2018-03-01T14:21:45.363CET | lvl=INFO | trans= | srv= | subsrv= | function=addProperty | comp=Cygnus | msg=org.apache.flume.conf.FlumeConfiguration$AgentConfiguration[930] : Added sinks: test-sink Agent: cygnusagent
time=2018-03-01T14:21:45.363CET | lvl=INFO | trans= | srv= | subsrv= | function=addProperty | comp=Cygnus | msg=org.apache.flume.conf.FlumeConfiguration$AgentConfiguration[1016] : Processing:test-sink
time=2018-03-01T14:21:45.368CET | lvl=INFO | trans= | srv= | subsrv= | function=validateConfiguration | comp=Cygnus | msg=org.apache.flume.conf.FlumeConfiguration[140] : Post-validation flume configuration contains configuration for agents: [cygnusagent]
time=2018-03-01T14:21:45.368CET | lvl=INFO | trans= | srv= | subsrv= | function=loadChannels | comp=Cygnus | msg=org.apache.flume.node.AbstractConfigurationProvider[150] : Creating channels
time=2018-03-01T14:21:45.372CET | lvl=INFO | trans= | srv= | subsrv= | function=create | comp=Cygnus | msg=org.apache.flume.channel.DefaultChannelFactory[40] : Creating instance of channel test-channel type memory
time=2018-03-01T14:21:45.374CET | lvl=INFO | trans= | srv= | subsrv= | function=loadChannels | comp=Cygnus | msg=org.apache.flume.node.AbstractConfigurationProvider[205] : Created channel test-channel
time=2018-03-01T14:21:45.374CET | lvl=INFO | trans= | srv= | subsrv= | function=create | comp=Cygnus | msg=org.apache.flume.source.DefaultSourceFactory[39] : Creating instance of source http-source, type org.apache.flume.source.http.HTTPSource
time=2018-03-01T14:21:45.376CET | lvl=ERROR | trans= | srv= | subsrv= | function=configure | comp=Cygnus | msg=org.apache.flume.source.http.HTTPSource[113] : Error while configuring HTTPSource. Exception follows.
java.lang.ClassNotFoundException: com.telefonica.iot.cygnus.handlers.NGSIRestHandler
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:264)
    at org.apache.flume.source.http.HTTPSource.configure(HTTPSource.java:102)
    at org.apache.flume.conf.Configurables.configure(Configurables.java:41)
    at org.apache.flume.node.AbstractConfigurationProvider.loadSources(AbstractConfigurationProvider.java:331)
    at org.apache.flume.node.AbstractConfigurationProvider.getConfiguration(AbstractConfigurationProvider.java:102)
    at org.apache.flume.node.PollingPropertiesFileConfigurationProvider$FileWatcherRunnable.run(PollingPropertiesFileConfigurationProvider.java:140)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access1(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
time=2018-03-01T14:21:45.378CET | lvl=ERROR | trans= | srv= | subsrv= | function=loadSources | comp=Cygnus | msg=org.apache.flume.node.AbstractConfigurationProvider[366] : Source http-source has been removed due to an error during configuration
java.lang.RuntimeException: java.lang.ClassNotFoundException: com.telefonica.iot.cygnus.handlers.NGSIRestHandler
    at com.google.common.base.Throwables.propagate(Throwables.java:156)
    at org.apache.flume.source.http.HTTPSource.configure(HTTPSource.java:114)
    at org.apache.flume.conf.Configurables.configure(Configurables.java:41)
    at org.apache.flume.node.AbstractConfigurationProvider.loadSources(AbstractConfigurationProvider.java:331)
    at org.apache.flume.node.AbstractConfigurationProvider.getConfiguration(AbstractConfigurationProvider.java:102)
    at org.apache.flume.node.PollingPropertiesFileConfigurationProvider$FileWatcherRunnable.run(PollingPropertiesFileConfigurationProvider.java:140)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access1(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: com.telefonica.iot.cygnus.handlers.NGSIRestHandler
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:264)
    at org.apache.flume.source.http.HTTPSource.configure(HTTPSource.java:102)
    ... 11 more
time=2018-03-01T14:21:45.379CET | lvl=INFO | trans= | srv= | subsrv= | function=create | comp=Cygnus | msg=org.apache.flume.sink.DefaultSinkFactory[40] : Creating instance of sink: test-sink, type: com.telefonica.iot.cygnus.sinks.NGSITestSink
time=2018-03-01T14:21:45.380CET | lvl=ERROR | trans= | srv= | subsrv= | function=run | comp=Cygnus | msg=org.apache.flume.node.PollingPropertiesFileConfigurationProvider$FileWatcherRunnable[142] : Failed to load configuration data. Exception follows.
org.apache.flume.FlumeException: Unable to load sink type: com.telefonica.iot.cygnus.sinks.NGSITestSink, class: com.telefonica.iot.cygnus.sinks.NGSITestSink
    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:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access1(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: com.telefonica.iot.cygnus.sinks.NGSITestSink
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:264)
    at org.apache.flume.sink.DefaultSinkFactory.getClass(DefaultSinkFactory.java:67)
    ... 11 more
time=2018-03-01T14:21:46.356CET | lvl=INFO | trans= | srv= | subsrv= | function=main | comp=Cygnus | msg=com.telefonica.iot.cygnus.nodes.CygnusApplication[254] : Waiting for valid Flume components references...
time=2018-03-01T14:21:47.367CET | lvl=INFO | trans= | srv= | subsrv= | function=main | comp=Cygnus | msg=com.telefonica.iot.cygnus.nodes.CygnusApplication[254] : Waiting for valid Flume components references...
time=2018-03-01T14:21:48.368CET | lvl=INFO | trans= | srv= | subsrv= | function=main | comp=Cygnus | msg=com.telefonica.iot.cygnus.nodes.CygnusApplication[254] : Waiting for valid Flume components references...
time=2018-03-01T14:21:49.371CET | lvl=INFO | trans= | srv= | subsrv= | function=main | comp=Cygnus | msg=com.telefonica.iot.cygnus.nodes.CygnusApplication[254] : Waiting for valid Flume components references...
time=2018-03-01T14:21:50.374CET | lvl=INFO | trans= | srv= | subsrv= | function=main | comp=Cygnus | msg=com.telefonica.iot.cygnus.nodes.CygnusApplication[254] : Waiting for valid Flume components references...

我已将 log4j.properties conf 文件配置为指向包含 cygnus.log 文件的有效日志目录

感谢帮助

您用于安装 cygnus 的页面属于旧版本的 Cygnus。请在此处访问最新版本:http://fiware-cygnus.readthedocs.io/en/latest/cygnus-ngsi/quick_start_guide/

这里需要注意的是 yum install cygnus 将安装一个相当旧的 cygnus 版本。您应该安装 yum install cygnus-ngsi 而不是较新的版本。

不过,我更喜欢关注 github 页面: https://github.com/telefonicaid/fiware-cygnus/tree/master/cygnus-ngsi 安装 cygnus-ngsi 并创建配置文件 /usr/cygnus/conf/agent_1.conf/usr/cygnus/conf/cygnus_instance_1 .conf如github所示。然后可以启动 Cygnus 服务。

http://fiware-cygnus.readthedocs.io/en/latest/cygnus-ngsi/quick_start_guide/ 中的 notification.sh 脚本很有用,您可以在 cygnus 达到 运行 后使用它。

./notification.sh http://localhost:5050/notify