我已经按照EMR页面上的步骤启动了AWS EMR集群。通过SSH(Windows 7中的putty)连接并启用foxyproxy(Chrome)之后,它启动得很好,可以在我的笔记本浏览器中访问。
Pyspark和sparkR与EMR Spark 1.6.0一起安装,并在终端中完美工作。
色调等端口工作正常,格式如下:
ec2-xx-xxx-xxx-xxx.us-west-2.compute.amazonaws.com网址:/
我按照http://jupyter.readthedocs.org/en/latest/install.html#using-pip上的步骤安装了Jupyter

sudo pip install jupyter

我打开一个新笔记本
jupyter notebook

它在终端中打开了一个浏览器,我关闭了它。它给出了以下输出:
[I 14:32:12.001 NotebookApp] Writing notebook server cookie secret to /home/hadoop/.local/share/jupyter/runtime/notebook_cookie_secret
[I 14:32:12.033 NotebookApp] The port 8888 is already in use, trying another random port.
[I 14:32:12.037 NotebookApp] Serving notebooks from local directory: /home/hadoop
[I 14:32:12.037 NotebookApp] 0 active kernels
[I 14:32:12.038 NotebookApp] The Jupyter Notebook is running at: http://localhost:8889/
[I 14:32:12.038 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).

我试图通过以下方式在浏览器中访问它:
本地主机:8889/
(当然没用)
然后由:
ec2 xx xxx xxx xxx.us-west-2.compute.amazonaws.com:8889/
(替换了x),但这也给出了一个错误。
This webpage is not available

ERR_CONNECTION_RESET

那么,当Jupyter安装在EMR集群的头节点上时,如何在本地浏览器中访问它呢?

最佳答案

我还没有真正使用Jupyter,但我试着像您一样安装和运行它,我注意到Jupyter默认配置为只在本地主机上侦听,这就是为什么您不能从浏览器访问它。
然后我发现运行“jupyter notebook--generate config”将生成一个配置文件~/.jupyter/jupyter_notebook_config.py,您可以编辑它,使其在0.0.0.0而不是本地主机上侦听。只需将c.NotebookApp.ip更改为“0.0.0.0”,然后取消对该行的注释。
这样做之后,我就可以使用类似http://ip-10-168-157-117.ec2.internal:8888/的URL从浏览器访问Jupyter。(默认情况下,我的监听端口是8888,但我假设您的监听端口是8889,因为已经安装了Hue并监听了8888端口。)

关于python - 在浏览器中访问EMR 4.3.0上安装的Jupyter Notebook,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/35319661/

10-11 09:19
查看更多