Support Questions

Find answers, ask questions, and share your expertise

LIVY-server don't work

avatar
Explorer

when i try to launch command  ./bin/livy-server   this error appear :  Could not find Livy jars directory.

 

note : I use centos . 

5 REPLIES 5

avatar
Master Mentor

@hicha 

Not Sure which product you are using.  However based on the command it looks like you are running the "livy-server" script from outside of the "bin" directory which may be causing the issue 

 

Because the Logic written inside the script "" is as following:

 

 

export LIVY_HOME=$(cd $(dirname $0)/.. && pwd)
.
.
.
start_livy_server() {
  LIBDIR="$LIVY_HOME/jars"
  if [ ! -d "$LIBDIR" ]; then
    LIBDIR="$LIVY_HOME/server/target/jars"
  fi
  if [ ! -d "$LIBDIR" ]; then
    echo "Could not find Livy jars directory." 1>&2
    exit 1
  fi

 

 

.

So ideally you should first change directory to "bin"  where the 'livy-server' script is present 

and then run it as following  OR try using the Full path in the. terminal for the 'livy-server' script

 

 

# cd /PATH/TO/LIVY_DIR/bin
# ./livy-server

(OR)

# /PATH/TO/LIVY_DIR/bin/livy-server

 

 

.

 

If you still find it difficult to run then try to put a "echo" statement as following inside the script "livy-server' to see what path it is resolving for the 'LIVY_HOME' and if the "LIVY_HOME/jars" directory exist with correct permission??

 

export LIVY_HOME=$(cd $(dirname $0)/.. && pwd)
echo "LIVY_HOME calculated as = $LIVY_HOME"

 

 

.

avatar
Explorer

Hi, is it mandatory to have spark and livy in the same machine ? if not how to export the two variables SPARK-HOME and HADOOP_CONF_DIR ? 
I'm sorry, but I'm finding it difficult to understand this .

avatar
Explorer

when I add the echo this is the result :livy.PNG

avatar
Master Mentor

@hicha 

Which product and version (HDP /CDH ....etc) are you using and from where have you downloaded the  "incubator-livy" ?

 

avatar
Explorer

Thank you for your collaboration, I found the solution. I'm using the wrong version of Livy.