Fiware 为什么天鹅座不继续跑?

Fiware 为什么天鹅座不继续跑?,fiware,fiware-cygnus,Fiware,Fiware Cygnus,按照上面的说明,我只更改了2个配置文件 第一个是cygnus_instance_1.conf(实际上我刚刚重命名了示例文件): 我甚至成功地完成了测试,并获得了以下输出: Tests run: 72, Failures: 0, Errors: 0, Skipped: 0 [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] -----

按照上面的说明,我只更改了2个配置文件

第一个是cygnus_instance_1.conf(实际上我刚刚重命名了示例文件):

我甚至成功地完成了测试,并获得了以下输出:

Tests run: 72, Failures: 0, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:28.380s
[INFO] Finished at: Tue Dec 08 15:25:16 CET 2015
[INFO] Final Memory: 43M/112M
[INFO] ------------------------------------------------------------------------
测试成功是因为我正确配置了java和maven:

[root@localhost fiware-cygnus]# echo $JAVA_HOME
/usr/java/jdk1.8.0_65
[root@localhost fiware-cygnus]# java -version
java version "1.8.0_65"
Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.65-b01, mixed mode)
[root@localhost fiware-cygnus]# mvn -version
Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 14:51:28+0100)
Maven home: /usr/local/maven
Java version: 1.8.0_65, vendor: Oracle Corporation
Java home: /usr/java/jdk1.8.0_65/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-504.12.2.el6.x86_64", arch: "amd64", family: "unix"
所以当我点击
服务天鹅座开始时一切都很好
,因为我得到:

Starting Cygnus 1...                                       [  OK  ]
但2秒钟后,当我点击
服务天鹅座状态时,我得到:

cygnus-flume-ng dead but pid file exists
顺便说一下,Context broker工作得很好,但它只是不知道我输入的订阅不会有任何进展

这是天鹅座的日志(没有时间戳,所以我将发布第一个和最后一个):


EDIT1:log4.properties(根据请求):

#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#  http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
#

# Define some default values that can be overridden by system properties.
#
# For testing, it may also be convenient to specify
# -Dflume.root.logger=DEBUG,console when launching flume.

#flume.root.logger=DEBUG,console
flume.root.logger=INFO,LOGFILE
flume.log.dir=./logs
flume.log.file=flume.log

log4j.logger.org.apache.flume.lifecycle = INFO
log4j.logger.org.jboss = WARN
log4j.logger.org.mortbay = INFO
log4j.logger.org.apache.avro.ipc.NettyTransceiver = WARN
log4j.logger.org.apache.hadoop = INFO

# Define the root logger to the system property "flume.root.logger".
log4j.rootLogger=${flume.root.logger}


# Stock log4j rolling file appender
# Default log rotation configuration
log4j.appender.LOGFILE=org.apache.log4j.RollingFileAppender
log4j.appender.LOGFILE.MaxFileSize=100MB
log4j.appender.LOGFILE.MaxBackupIndex=10
log4j.appender.LOGFILE.File=${flume.log.dir}/${flume.log.file}
log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
log4j.appender.LOGFILE.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss,SSS} %-5p [%t] (%C.%M:%L) %x - %m%n


# Warning: If you enable the following appender it will fill up your disk if you don't have a cleanup job!
# This uses the updated rolling file appender from log4j-extras that supports a reliable time-based rolling policy.
# See http://logging.apache.org/log4j/companions/extras/apidocs/org/apache/log4j/rolling/TimeBasedRollingPolicy.html
# Add "DAILY" to flume.root.logger above if you want to use this
log4j.appender.DAILY=org.apache.log4j.rolling.RollingFileAppender
log4j.appender.DAILY.rollingPolicy=org.apache.log4j.rolling.TimeBasedRollingPolicy
log4j.appender.DAILY.rollingPolicy.ActiveFileName=${flume.log.dir}/${flume.log.file}
log4j.appender.DAILY.rollingPolicy.FileNamePattern=${flume.log.dir}/${flume.log.file}.%d{yyyy-MM-dd}
log4j.appender.DAILY.layout=org.apache.log4j.PatternLayout
log4j.appender.DAILY.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss,SSS} %-5p [%t] (%C.%M:%L) %x - %m%n


# console
# Add "console" to flume.root.logger above if you want to use this
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.target=System.err
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%d (%t) [%p - %l] %m%n
EDIT2以下是ls-l命令的结果:

[root@localhost conf]# ls -l
total 64
-rwxr-xr-x. 1 root   root    5289 Nov 30 12:23 agent_1.conf
-rwxr-xr-x. 1 cygnus cygnus 14481 Nov  5 15:45 agent.conf.template
-rwxr-xr-x. 1 root   root    1732 Nov 30 09:29 cygnus_instance_1.conf
-rwxr-xr-x. 1 cygnus cygnus  1732 Nov  5 15:45 cygnus_instance.conf.template
-rwxr-xr-x. 1 cygnus cygnus  1197 Nov  5 15:45 flume-env.sh.template
-rwxr-xr-x. 1 root   root    3597 Dec  7 12:15 grouping_rules.conf
-rwxr-xr-x. 1 cygnus cygnus  3597 Nov  5 15:45 grouping_rules.conf.template
-rwxr-xr-x. 1 cygnus cygnus   325 Nov  5 15:45 krb5.conf.template
-rwxr-xr-x. 1 cygnus cygnus   135 Nov  5 15:45 krb5_login.conf
-rwxr-xr-x. 1 cygnus cygnus  3063 Nov  5 15:45 log4j.properties
-rwxr-xr-x. 1 cygnus cygnus  3659 Nov  5 15:45 log4j.properties.template
-rwxr-xr-x. 1 cygnus cygnus  2195 Nov  5 15:45 README.md
编辑2.1以下是var/log/cygnus的所有权:

[root@localhost conf]# ls -l /var/log/cygnus
total 16
-rw-rw-r--. 1 cygnus cygnus 14152 Dec  9 14:37 cygnus.log
编辑3我的最新日志:

Warning: JAVA_HOME is not set!
+ exec /usr/bin/java -Xmx20m -Dflume.log.file=cygnus.log -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.CygnusApplic$
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.10.0-jar-with-dependencies.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
11 Dec 2015 11:16:13,101 ERROR [main] (com.telefonica.iot.cygnus.nodes.CygnusApplication.main:250)  - A fatal error occurred while running. Exception follows. Details=The specified configuration file does not exist: /usr/cygnus/conf/agent.conf

如果您不熟悉FIWARE技术,请忽略此问题

问题与日志写入有关。默认情况下,日志写入
conf/log4j.properties
指定的路径,即
/logs/flume.log
。然而,这样的路径应该被放置在
conf/cygnys_instance_1.conf
的配置覆盖,即
/var/log/cygnus/cygnus.log
。我仍然不知道为什么(可能有bug),但是您的Cygnus正在覆盖日志文件名(
Cygnus.log
),而不是路径(
/log
)。结果是Cygnus尝试在
/log/Cygnus.log
中写入,我猜
是只允许写入
根用户的路径(Cygnus作为
Cygnus
用户运行)。解决方法是编辑
log4j.properties
并配置:

flume.log.dir=/var/log/cygnus

我遇到了同样的错误,并通过更改
cygnus\u instance\uu.conf
中的配置文件修复了它:

CONFIG_FILE=/usr/cygnus/conf/agent_<id>.conf
CONFIG_FILE=/usr/cygnus/conf/agent_u.conf

能否显示
conf/log4j.properties
的内容?@frb I已按要求添加。我应该强调的是,我没有接触该文件,并将其保留为默认状态,因为在安装过程中没有另外指定该文件…我不应该被修改。。。但是日志文件有问题。
conf`中所有文件的权限是什么?哪些是
/var/log/cygnus`?@frb嗨,请查看我的上一次编辑2,在那里我做了ls-lI编辑了我的问题,其中包括我的最新日志。请检查一下,因为你的解决方案还没有解决我的问题。天鹅座现在在5秒后死亡…好吧,我想出来了,我刚刚将agent_1.conf重命名为agent.conf,它正在运行。我现在的问题是,我是否应该将cygnus_instance_1.conf重命名为cygnus_instance.conf?您不应该这样做。在
agent_uu.conf
cygnus\u instance_uu.conf
中都需要id(
1
)。这就是Cygnus的几种配置同时运行的方式(只是告诉您,我认为这不是您可能需要的功能)。
[root@localhost conf]# ls -l /var/log/cygnus
total 16
-rw-rw-r--. 1 cygnus cygnus 14152 Dec  9 14:37 cygnus.log
Warning: JAVA_HOME is not set!
+ exec /usr/bin/java -Xmx20m -Dflume.log.file=cygnus.log -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.CygnusApplic$
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.10.0-jar-with-dependencies.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
11 Dec 2015 11:16:13,101 ERROR [main] (com.telefonica.iot.cygnus.nodes.CygnusApplication.main:250)  - A fatal error occurred while running. Exception follows. Details=The specified configuration file does not exist: /usr/cygnus/conf/agent.conf
flume.log.dir=/var/log/cygnus
CONFIG_FILE=/usr/cygnus/conf/agent_<id>.conf