4

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?

Jacek Laskowski
  • 72,696
  • 27
  • 242
  • 420
juniper-
  • 6,262
  • 10
  • 37
  • 65

3 Answers3

7

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.

Community
  • 1
  • 1
Andy Petrella
  • 4,345
  • 26
  • 29
0

Run the ipython notebook using following command

ipython notebook --no-browser --profile=pyspark --ip=*

then try

open http://$(boot2docker ip):8888

For more details refer this post

prabeesh
  • 935
  • 9
  • 11
0

In the event that you get the following error:

➜ VBoxManage modifyvm "boot2docker-vm" --natpf1 "tcp-port9000,tcp,,9000,,9000" VBoxManage: error: The machine 'boot2docker-vm' is already locked for a session (or being unlocked) VBoxManage: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component Machine, interface IMachine, callee nsISupports VBoxManage: error: Context: "LockMachine(a->session, LockType_Write)" at line 471 of file VBoxManageModifyVM.cpp

You can resolve it by stopping the VM, applying your change, and starting boot2docker again...

1) boot2docker stop

2) VBoxManage modifyvm "boot2docker-vm" --natpf1 "tcp-port9000,tcp,,9000,,9000"

3) boot2docker start

babalu
  • 602
  • 5
  • 15