无法从Windows 10连接到jupyter笔记本电脑ec2服务器

时间:2017-12-01 14:45:15

标签: amazon-web-services amazon-ec2 jupyter-notebook

我花了好几天时间来解决这个问题而没有解决方案。

[ec2-user@ip-172-31-28-86 mynotebooks]$ jupyter notebook
[I 14:34:22.588 NotebookApp] [nb_conda_kernels] enabled, 15 kernels found
[I 14:34:22.615 NotebookApp] Writing notebook server cookie secret to /home/ec2-user/.local/share/jupyter/runtime/notebook_cookie_secret
[I 14:34:24.129 NotebookApp] [nb_anacondacloud] enabled
[I 14:34:24.250 NotebookApp] [nb_conda] enabled
[I 14:34:25.199 NotebookApp] ✓ nbpresent HTML export ENABLED
[W 14:34:25.199 NotebookApp] ✗ nbpresent PDF export DISABLED: No module named 'n                                                                                                                                                             bbrowserpdf'
[I 14:34:37.849 NotebookApp] sparkmagic extension enabled!
[I 14:34:37.854 NotebookApp] Serving notebooks from local     directory: /home/ec2-user/mynotebooks
[I 14:34:37.854 NotebookApp] 0 active kernels
[I 14:34:37.854 NotebookApp] The Jupyter Notebook is running at:
    [I 14:34:37.854 NotebookApp] https://[all ip addresses on your system]:8888/
    [I 14:34:37.854 NotebookApp] Use Control-C to stop this server and shut down all 

我已完成设置过程,这是我的输出。 但是当我尝试打开端口号为8888的url(aws中的公共域url)时,它不会打开超时错误。 之前提出的问题都没有解决我的问题

1 个答案:

答案 0 :(得分:2)

您能否确认已配置应用于ec2实例的安全组,以便您在端口8888上进行连接?

当您通过公共互联网连接时,我建议您通过SSH隧道连接。

使用Windows上的Putty通过SSH创建隧道:

  1. 登录您的遥控盒
  2. 启动Jupyter Notebnook $ jupyter notebook --ip='*' --no-browser
  3. 请注意Jupyter使用的端口。在此示例中,它是 8846 。 请参阅:The Jupyter Notebook is running at: http://[all ip addresses on your system]:8846
  4. 启动另一个Putty窗口并突出显示用于连接到您的实例的会话,然后点击"加载"按钮
  5. 向下导航到Connection | SSH |隧道
  6. 在"中输入您要连接到本地计算机上的端口。 "源端口" (我在这个例子中使用5500)
  7. 输入目的地地址ec2-XXX-XXX-XXX-XXX.compute-1.amazonaws.com:8846,然后点击"添加"按钮
  8. 导航回您的会话,点击"保存",然后点击"连接"
  9. 您现在应该可以在网络浏览器中输入http://localhost:5500并连接到Jupyter
  10. 更多信息:

    An example of someone tunneling through a proxy

    Some excellent screenshots here

    An informative Stack Overflow thread