4

在 OSX(通过 boot2docker)上使用 docker 运行 spark-notebook 似乎没有任何作用。这是输出

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

当我将浏览器指向http://localhost:9000时,它说该网页不可用。我错过了什么吗?是不是配置错误?

4

3 回答 3

7

使用boot2docker运行 spark notebook需要一个额外的命令才能运行。

实际上 docker 中的端口转发是不够的,还必须在 VM 级别完成才能访问主机(localhost/127.0.0.1)。

这是所需的额外命令: VBoxManage modifyvm "boot2docker-vm" --natpf1 "tcp-port9000,tcp,,9000,,9000"

@see this question了解更多详情。

于 2015-02-07T14:15:49.950 回答
0

使用以下命令运行 ipython 笔记本

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

然后尝试

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

有关更多详细信息,请参阅此帖子

于 2015-06-19T20:26:28.443 回答
0

如果您收到以下错误:

➜ 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

您可以通过停止 VM、应用更改并再次启动 boot2docker 来解决它...

1)boot2docker stop

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

3)boot2docker start

于 2015-11-27T17:22:27.717 回答