Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set up mesos for running spark on standalone OS/X

I want to do testing of Spark programs on a Mac. Spark is running and my spark scala program compiles: but there is a library (mesos.so ?) error at runtime:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no mesos in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1758)
    at java.lang.Runtime.loadLibrary0(Runtime.java:823)
    at java.lang.System.loadLibrary(System.java:1045)
    at org.apache.mesos.MesosNativeLibrary.load(MesosNativeLibrary.java:46)
    at spark.SparkContext.<init>(SparkContext.scala:170)
    at com.blazedb.scala.ccp.spark.LoadRDD$.main(LoadRDD.scala:14)

What setup is required on os/x beyond the spark server itself for mesos in order to run a spark client program?

like image 851
WestCoastProjects Avatar asked Jan 06 '14 00:01

WestCoastProjects


People also ask

Can we run Apache Spark with Mesos?

Spark can run on hardware clusters managed by Apache Mesos. The advantages of deploying Spark with Mesos include: dynamic partitioning between Spark and other frameworks. scalable partitioning between multiple instances of Spark.

How do you use Mesos in spark?

Steps to use the cluster modeStart the MesosClusterDispatcher in your cluster: ./sbin/start-mesos-dispatcher.sh -master mesos://mesosmaster:5050. This will generally start the dispatcher at port 7077. From the client, submit a job to the mesos cluster by Spark-submit specifying the dispatcher URL.

How do you set up Mesos?

Mesos Runtime Configuration Each option can be set in two ways: By passing it to the binary using --option_name=value , either specifying the value directly, or specifying a file in which the value resides ( --option_name=file://path/to/file ). The path can be absolute or relative to the current working directory.


3 Answers

You need to set 'MESOS_NATIVE_LIBRARY' environment variable, which is the location of libmesos.so. It's typically /usr/local/lib/libmesos.so.

# For Linux
$ export MESOS_NATIVE_LIBRARY='/usr/local/lib/libmesos.so'

# For OSX
$ export MESOS_NATIVE_LIBRARY='/usr/local/lib/libmesos.dylib'

I would recommend adding that line to your .bashrc as well, to avoid doing that every time.

like image 200
mohitsoni Avatar answered Oct 03 '22 22:10

mohitsoni


If you want to use Spark with Mesos, there are instructions on the project website, including notes on how to find the path to the Mesos library on OS X.

As you've noticed, there are other deployment modes, including the local modes, that don't require Mesos to be installed.

Based on your stacktrace, it looks like you might be using an older version of Spark. Since Spark 0.8.0+, the packages have been moved into the org.apache.spark namespace, so you might need to use earlier versions of the docs if you don't want to upgrade.

like image 23
Josh Rosen Avatar answered Oct 03 '22 23:10

Josh Rosen


if you build mesos from sources then all generated libs will be generated inside [MESOS_HOME]/src/.libs folder. You must delete the empty [MESOS_HOME]/.libs folder and create symbolic link to [MESOS_HOME]/src/.libs

Used commands are:

  • rm -r [MESOS_HOME]/src/.libs
  • ln -s [MESOS_HOME]/src/.libs [MESOS_HOME]/.libs

lost my problem "g++: error: ./.libs/libmesos.so: No such file or directory"

like image 44
nix Avatar answered Oct 04 '22 00:10

nix