Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run spark-notebook on docker on MacOS X?

Running the spark-notebook using docker on OSX (via boot2docker) doesn't seem to do anything. Here's the output

pkerp@toc:~/apps/spark-notebook$ docker run -p 9000:9000 andypetrella/spark-notebook:0.1.4-spark-1.2.0-hadoop-1.0.4
Play server process ID is 1
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/docker/lib/spark-repl_2.10-1.2.0-notebook.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/docker/lib/ch.qos.logback.logback-classic-1.1.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/docker/lib/org.slf4j.slf4j-log4j12-1.7.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
15/02/07 11:51:32 INFO play: Application started (Prod)
15/02/07 11:51:32 INFO play: Listening for HTTP on /0:0:0:0:0:0:0:0:9000

When I point my browser at http://localhost:9000, it says the web page is not available. Am I missing something? Is something misconfigured?

like image 241
juniper- Avatar asked Mar 17 '23 03:03

juniper-


1 Answers

Running the spark notebook using boot2docker will need an extra command necessary for it to work.

Actually the port forwarding in docker is not enough and has to be done at the VM level as well to give it access to the host (localhost/127.0.0.1).

Here is the needed extra command: VBoxManage modifyvm "boot2docker-vm" --natpf1 "tcp-port9000,tcp,,9000,,9000"

@see this question for more details.

like image 72
Andy Petrella Avatar answered Mar 20 '23 13:03

Andy Petrella