ssh AWS,Jupyter Notebook未显示在Web浏览器上 [英] ssh AWS, Jupyter Notebook not showing up on web browser

查看:286
本文介绍了ssh AWS,Jupyter Notebook未显示在Web浏览器上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用ssh连接到AWS适用于Amazon Linux的深度学习AMI",并且除Jupyter Notebook外,其他所有功能都可以正常工作.这就是我得到的:

I am trying to use ssh connecting to AWS "Deep Learning AMI for Amazon Linux", and everything works fine except Jupyter Notebook. This is what I got:

ssh -i ~/.ssh/id_rsa ec2-user@yy.yyy.yyy.yy

给我

Last login: Wed Oct  4 18:01:23 2017 from 67-207-109-187.static.wiline.com

=============================================================================
       __|  __|_  )
       _|  (     /   Deep Learning AMI for Amazon Linux
      ___|\___|___|

The README file for the AMI ➜➜➜➜➜➜➜➜➜➜➜➜➜➜➜➜➜➜➜➜  /home/ec2-user/src/README.md
Tests for deep learning frameworks ➜➜➜➜➜➜➜➜➜➜➜➜   /home/ec2-user/src/bin
=============================================================================

1 package(s) needed for security, out of 3 available
Run "sudo yum update" to apply all updates.
Amazon Linux version 2017.09 is available.

然后

[ec2-user@ip-xxx-xx-xx-xxx ~]$ jupyter notebook
[I 16:32:14.172 NotebookApp] Writing notebook server cookie secret to /home/ec2-user/.local/share/jupyter/runtime/notebook_cookie_secret
[I 16:32:14.306 NotebookApp] Serving notebooks from local directory: /home/ec2-user
[I 16:32:14.306 NotebookApp] 0 active kernels 
[I 16:32:14.306 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/?token=74e2ad76eee284d70213ba333dedae74bf043cce331257e0
[I 16:32:14.306 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[W 16:32:14.307 NotebookApp] No web browser found: could not locate runnable browser.
[C 16:32:14.307 NotebookApp] 


Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
    http://localhost:8888/?token=74e2ad76eee284d70213ba333dedae74bf043cce331257e0

复制http://localhost:8888/?token=74e2ad76eee284d70213ba333dedae74bf043cce331257e0并获取

"can’t establish a connection to the server at localhost:8888."在Firefox上,

"can’t establish a connection to the server at localhost:8888." on Firefox,

"This site can’t be reached localhost refused to connect."在Chrome上

"This site can’t be reached localhost refused to connect." on Chrome

进一步, jupyter notebook --ip=yy.yyy.yyy.yy --port=8888给出

Traceback (most recent call last):
  File "/usr/bin/jupyter-notebook", line 11, in <module>
    sys.exit(main())
  File "/usr/lib/python3.4/dist-packages/jupyter_core/application.py", line 267, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/usr/lib/python3.4/dist-packages/traitlets/config/application.py", line 657, in launch_instance
    app.initialize(argv)
  File "<decorator-gen-7>", line 2, in initialize
  File "/usr/lib/python3.4/dist-packages/traitlets/config/application.py", line 87, in catch_config_error
    return method(app, *args, **kwargs)
  File "/usr/lib/python3.4/dist-packages/notebook/notebookapp.py", line 1296, in initialize
    self.init_webapp()
  File "/usr/lib/python3.4/dist-packages/notebook/notebookapp.py", line 1120, in init_webapp
    self.http_server.listen(port, self.ip)
  File "/usr/lib64/python3.4/dist-packages/tornado/tcpserver.py", line 142, in listen
    sockets = bind_sockets(port, address=address)
  File "/usr/lib64/python3.4/dist-packages/tornado/netutil.py", line 197, in bind_sockets
    sock.bind(sockaddr)
OSError: [Errno 99] Cannot assign requested address

请注意,这将对您有所帮助(仅对MXNet有用吗?我对MXNet不熟悉)

Note sure this will be helpful (Is it only for MXNet ? I am not familiar with MXNet) Jupyter_MXNet

推荐答案

localhost仅在尝试从计算机本身使用jupyter(或其他任何方式)时才起作用.在这种情况下,您似乎正在尝试从另一台计算机访问它.

localhost will only work when trying to use jupyter (or well, anything) from the machine itself. In this case, it seems you're trying to access it from another machine.

您可以使用-ip = abcd 开关进行操作,其中 abcd 是EC2实例的公共地址(或使用 0.0.0.0 ,使其在所有界面中进行监听.)

You can do that with the switch --ip=a.b.c.d, where a.b.c.d is the public address of your EC2 instance (or using 0.0.0.0 to make it listen in all interfaces.)

您还可以使用-port = X 定义要监听的特定端口号.

You can also use --port=X to define a particular port number to listen to.

请记住,您的安全组必须允许从外部访问您选择的IP/端口.

Just remember that your security group must allow access from the outside into your choice of IP/Port.

例如:

jupyter笔记本--ip = a.b.c.d --port = 8888

jupyter notebook --ip=a.b.c.d --port=8888

这篇关于ssh AWS,Jupyter Notebook未显示在Web浏览器上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆