You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by ayandas84 <ay...@gmail.com> on 2014/09/10 06:14:17 UTC

How to set java.library.path in a spark cluster

Hi,

I am working on a 3 machine cloudera cluster. Whenever I submit a spark job
as a jar file with native dependency on mosek it shows the following error.

java.lang.UnsatisfiedLinkError: no mosekjava7_0 in java.library.path

How should I set the java.library.path. I printed the environment variable
and it shows;
-Djava.library.path= -Xms512m -Xmx512m,

I added the following lines to the spark-env.sh file but it was of no help.
The path contains both the mosek.jar and the libmosek_7.0.so files.

export
SPARK_LIBRARY_PATH=${SPARK_HOME}/lib:/home/chanda/mosek/7/tools/platform/linux64x86/bin
export
SPARK_MASTER_OPTS='-Djava.library.path="/home/chanda/mosek/7/tools/platform/linux64x86/bin'
export
SPARK_WORKER_OPTS='/home/chanda/mosek/7/tools/platform/linux64x86/bin'
export
SPARK_HISTORY_OPTS='/home/chanda/mosek/7/tools/platform/linux64x86/bin'
export
SPARK_DAEMON_JAVA_OPTS='/home/chanda/mosek/7/tools/platform/linux64x86/bin'

Please help




--
View this message in context: http://apache-spark-user-list.1001560.n3.nabble.com/How-to-set-java-library-path-in-a-spark-cluster-tp13854.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@spark.apache.org
For additional commands, e-mail: user-help@spark.apache.org


Re: How to set java.library.path in a spark cluster

Posted by qihong <qc...@pivotal.io>.
Add something like following to spark-env.sh
export LD_LIBRARY_PATH=<path of libmosekjava7_0.so>:$LD_LIBRARY_PATH

(and remove all 5 exports you listed). Then restart all worker nodes, and
try
again.

Good luck!



--
View this message in context: http://apache-spark-user-list.1001560.n3.nabble.com/How-to-set-java-library-path-in-a-spark-cluster-tp13854p13857.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@spark.apache.org
For additional commands, e-mail: user-help@spark.apache.org