2

I installed cygnus and when I hit sudo service cygnus start I get the status OK running.

But the log file says:

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.

I checked echo $JAVA_HOME and get:

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

I also checked java -version and got:

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)

So what am I missing here?

I did all these steps here:

Installing Cygnus

Open a terminal and simply configure the FIWARE repository if not yet configured and use your applications manager in order to install the latest version of Cy gnus (CentOS/RedHat example):

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

IMPORTANT NOTE:

Cygnus, as it is based on Apache Flume, needs Java SDK is installed. If not yet installed, do it right now:

$ sudo yum install java-1.6.0-openjdk-devel

Remember to export the JAVA_HOME environment variable. In the case you have installed Java SDK right now as shown above, this would be as:

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

In order to do it permanently, edit /root/.bash_profile (root user) or /etc/profile (other users).

4

1 回答 1

1

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

# 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
于 2015-04-22T12:03:19.163 回答