未设置Cygnus JAVA_HOME

时间:2015-04-22 11:27:23

标签: fiware fiware-cygnus

我安装了天鹅座,当我点击sudo service cygnus start时,我的状态正常运行。

但是日志文件说:

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= es.tid.fiware.fiwareconnectors.cygnus.nodes.CygnusApplication -p 8081 -f /usr/cygnus/conf/agent_1.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.7.1-jar-with-dependencies.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.

我检查了echo $JAVA_HOME并获得了:

/usr/lib/jvm/java-1.6.0-openjdk.x86_64

我还检查了java -version并得到了:

java version "1.6.0_35"
OpenJDK Runtime Environment (IcedTea6 1.13.7) (rhel-1.13.7.1.el6_6-x86_64)
OpenJDK 64-Bit Server VM (build 23.25-b01, mixed mode)

那么我在这里缺少什么?

我在这里做了所有这些步骤:

  

安装Cygnus

     

打开终端并简单地配置FIWARE存储库(如果尚未配置)   配置并使用您的应用程序管理器以安装   最新版本的Cy gnus(CentOS / RedHat示例):

     

$ sudo cat&gt; /etc/yum.repos.d/fiware.repo<tp://repositories.testbed.fi-ware.eu/repo/rpm/x86_64/   gpgcheck = 0 enabled = 1 EOL $ sudo yum install cygnus

     

重要提示:

     

Cygnus,因为它基于Apache Flume,需要安装Java SDK。   如果尚未安装,请立即执行:

     

$ sudo yum install java-1.6.0-openjdk-devel

     

请记住导出JAVA_HOME环境变量。在你的情况下   现在已经安装了Java SDK,如上所示,这将是:

     

$ export JAVA_HOME = / usr / lib / jvm / java-1.6.0-openjdk.x86_64

     

要永久执行此操作,请编辑/root/.bash_profile(root用户)或   / etc / profile(其他用户)。

1 个答案:

答案 0 :(得分:1)

尽管有这样的警告消息,如果未设置JAVA_HOME,Cygus将运行,因为flume-ng(和派生的cygnus-flume-ng)脚本查找Java:

# find java
if [ -z "${JAVA_HOME}" ] ; then
  warn "JAVA_HOME is not set!"
  # Try to use Bigtop to autodetect JAVA_HOME if it's available
  if [ -e /usr/libexec/bigtop-detect-javahome ] ; then
    . /usr/libexec/bigtop-detect-javahome
  elif [ -e /usr/lib/bigtop-utils/bigtop-detect-javahome ] ; then
    . /usr/lib/bigtop-utils/bigtop-detect-javahome
  fi

  # Using java from path if bigtop is not installed or couldn't find it
  if [ -z "${JAVA_HOME}" ] ; then
    JAVA_DEFAULT=$(type -p java)
    [ -n "$JAVA_DEFAULT" ] || error "Unable to find java executable. Is it in your PATH?" 1
    JAVA_HOME=$(cd $(dirname $JAVA_DEFAULT)/..; pwd)
  fi
fi