简体   繁体   English

无法连接到 Amazon AWS Ec2 实例上的 jupyter notebook

[英]Cannot connect to jupyter notebook on Amazon AWS Ec2 instance

I'm running Amazon Linux 2 AMI EC2 instance.我正在运行 Amazon Linux 2 AMI EC2 实例。 On the instance, I'm able to install anaconda.在实例上,我可以安装 anaconda。 After setting jupyter notebook config etc. I tried to open jupyter notebook on Chrome using the url https://ip-xxx-xx-x-xx.us-east-2.compute.internal:8888/ from nohup.out.设置 jupyter notebook 配置等后,我尝试使用来自 nohup.out 的 url https://ip-xxx-xx-x-xx.us-east-2.compute.internal:8888/在 Chrome 上打开 jupyter notebook。 The link never worked.该链接从未奏效。

1. Here is my Network settings: 1.这是我的网络设置: 在此处输入图像描述

2. And here is my jupyter notebook config: 2.这是我的 jupyter notebook 配置:

c = get_config()
c.IPKernelApp.pylab = 'inline'
c.NotebookApp.certfile = u'/home/ec2-user/certs/mycert.pem'
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
# Your password below will be whatever you copied earlier
c.NotebookApp.password = u'xxxxx'
c.NotebookApp.port = 8888

3. And here is the log after running nohup jupyter notebook : 3.这是运行nohup jupyter notebook后的日志:

[I 15:51:03.957 NotebookApp] Writing notebook server cookie secret to /home/ec2-user/.local/share/jupyter/runtime/notebook_cookie_secret
[I 15:51:04.525 NotebookApp] JupyterLab extension loaded from /home/ec2-user/anaconda3/lib/python3.8/site-packages/jupyterlab
[I 15:51:04.525 NotebookApp] JupyterLab application directory is /home/ec2-user/anaconda3/share/jupyter/lab
[I 15:51:04.528 NotebookApp] Serving notebooks from local directory: /home/ec2-user/Notebook
[I 15:51:04.528 NotebookApp] The Jupyter Notebook is running at:
[I 15:51:04.528 NotebookApp] https://ip-xxx-xx-x-xx.us-east-2.compute.internal:8888/
[I 15:51:04.528 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).

I believe it should be a security setting issue.我认为这应该是一个安全设置问题。 But I already allowed SSH traffic from anywhere and also allow HTTPs traffic from the internet.但我已经允许来自任何地方的 SSH 流量,也允许来自互联网的 HTTPs 流量。

Anything wrong with the above?以上有什么问题吗? Please share if you have any clues.如果您有任何线索,请分享。 Thanks!!谢谢!!

Did you try using the public dns that's listed on your EC2 instance?您是否尝试使用您的 EC2 实例上列出的公共 dns ? This is considering you have configured your EC2 in a public subnet that has an internet gateway.这是考虑到您已在具有 Internet 网关的公共子网中配置了 EC2。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM