gpt4 book ai didi

amazon-ec2 - 无法连接到AWS EC2实例上的Jupyter Notebook

转载 作者:行者123 更新时间:2023-12-03 08:14:17 26 4
gpt4 key购买 nike

我正在AWS EC2实例上运行Ubuntu 14.04 LTS。
我正在尝试从MacBookPro连接到Safari中的Jypter。
我在安全组中打开了https端口443和TCP 8888。

ubuntu@ip-10-0-1-62:~$ netstat -a  | grep 8888
tcp 0 0 localhost:8888 *:* LISTEN
tcp 0 0 localhost:8888 localhost:36190 TIME_WAIT
ubuntu@ip-10-0-1-62:~$ netstat -a | grep 443
unix 3 [ ] STREAM CONNECTED 12443
ubuntu@ip-10-0-1-62:~$


我无法从Mac上的Safari浏览器连接到Jupyter。
(我可以在端口6006上连接Tensorboard)。

ubuntu@ip-10-0-1-62:~$ jupyter notebook
[W 20:40:14.909 NotebookApp] Unrecognized JSON config file version, assuming version 1
[I 20:40:14.921 NotebookApp] Writing notebook server cookie secret to /run/user/1000/jupyter/notebook_cookie_secret
[I 20:40:15.224 NotebookApp] JupyterLab alpha preview extension loaded from /home/ubuntu/anaconda/lib/python2.7/site-packages/jupyterlab
[I 20:40:15.230 NotebookApp] Serving notebooks from local directory: /home/ubuntu
[I 20:40:15.230 NotebookApp] 0 active kernels
[I 20:40:15.230 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/?token=c08a71a48c6e159bdbdcc95837c4e2e053349382c681899b
[I 20:40:15.231 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 20:40:15.232 NotebookApp]

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


enter image description here

$ telnet 52.8.16.250 8888
Trying 52.8.16.250...
telnet: connect to address 52.8.16.250: Connection refused
telnet: Unable to connect to remote host
$ telnet 52.8.16.250 6006
Trying 52.8.16.250...
telnet: connect to address 52.8.16.250: Connection refused
telnet: Unable to connect to remote host
$ telnet 52.8.16.250 8080
Trying 52.8.16.250...
telnet: connect to address 52.8.16.250: Connection refused
telnet: Unable to connect to remote host
$ telnet ec2-52-8-16-250.us-west-1.compute.amazonaws.com 8888
Trying 52.8.16.250...
telnet: connect to address 52.8.16.250: Connection refused
telnet: Unable to connect to remote host
$ telnet ec2-52-8-16-250.us-west-1.compute.amazonaws.com 20
Trying 52.8.16.250...

telnet: connect to address 52.8.16.250: Operation timed out
telnet: Unable to connect to remote host

最佳答案

好的,发现了问题:

编辑您的jupyter配置:

jupyter notebook --generate-config

vim /home/ubuntu/.jupyter/jupyter_notebook_config.py


确保

c.NotebookApp.ip = '*'


还要确保您在EC2服务器中打开了相关的安全组(例如端口8888)。

运行Jupyter:

jupyter notebook


现在,您可以使用正确的端口远程访问它

关于amazon-ec2 - 无法连接到AWS EC2实例上的Jupyter Notebook,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43241272/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com