2
votes

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).

1
have you rebooted after do the export JAVA_HOME... ? Do you execute echo JAVA_HOME after start cygnus?exoddus
Yes I have rebooted, and I echo JAVA_HOME before and after cygnus start its the sameVrankela
are you executing the export JAVA_HOME and cygnus in the same terminal window?exoddus
Im not executing it any more because I edited the /root/.bash_profile like so: # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/bin export JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk.x86_64 export PATH=$JAVA_HOME/bin:$PATH "~/.bash_profile" 14L, 254CVrankela

1 Answers

1
votes

Despite such a warning message, Cygus will run since the flume-ng (and derived cygnus-flume-ng) script looks for Java if JAVA_HOME is not set:

# 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