您好我遵循了天鹅座的快速入门指南(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.access$301(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.access$301(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.access$301(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配置文件配置为指向包含cygnus.log文件的有效日志目录
感谢您的帮助
答案 0 :(得分:0)
您用于安装cygnus的页面属于较早版本的Cygnus。请在此处访问最新版本:http://fiware-cygnus.readthedocs.io/en/latest/cygnus-ngsi/quick_start_guide/
这里需要注意的是yum install 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
脚本非常有用,您可以在天鹅座运行后使用它。
./notification.sh http://localhost:5050/notify