简体   繁体   English

如何在 AWS 上启动 jupyter notebook

[英]How to start jupyter notebook on AWS

I am a beginner for Amazon Ec2 and recently I successfully ssh to EC2 instance.我是 Amazon Ec2 的初学者,最近我成功通过 ssh 连接到 EC2 实例。 yet when I tried to activate jupyter before ssh:然而,当我尝试在 ssh 之前激活 jupyter 时:

jupyter notebook --no-browser --port=8888

I get the message:我收到消息:

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

I copied the URL as instructed to the browser (chrome and safari), but it did not work.我按照指示将 URL 复制到浏览器(chrome 和 safari),但是没有用。 How could I proceed to ssh jupyter notebook?我怎样才能继续使用 ssh jupyter notebook? Thanks!谢谢!

I hope you just didn't copied the link as it is (locahost), it is running on ec2, not on your computer.我希望您没有按原样复制链接(locahost),它在 ec2 上运行,而不是在您的计算机上运行。 So change the server name to IP address of your EC2 instance (assuming you allowed traffic on correct ports)因此,将服务器名称更改为 EC2 实例的 IP 地址(假设您允许正确端口上的流量)

There are a few guides how to access jupyter notebooks on remote servers, eg see https://jupyter-notebook.readthedocs.io/en/stable/public_server.html#notebook-public-server有一些指南如何访问远程服务器上的 jupyter 笔记本,例如,请参阅https://jupyter-notebook.readthedocs.io/en/stable/public_server.html#notebook-public-server

If you are just playing along and don't care about security in this case, you may just update the binding IP in your jupyter_notebook_config.py :如果你只是玩玩,在这种情况下不关心安全性,你可以只更新jupyter_notebook_config.py 中的绑定 IP:

c.NotebookApp.ip = '*'

You can start the jupyter server using the following command:-您可以使用以下命令启动 jupyter 服务器:-

jupyter notebook --ip=*

If you want to keep it running even after the terminal is closed then use:-如果您想在终端关闭后保持运行,请使用:-

nohup jupyter notebook --ip=* > nohup_jupyter.out&

Remember to open the port 8888 in the AWS EC2 security group inbound to Anywhere (0.0.0.0/0, ::/0)记得打开入站到 Anywhere (0.0.0.0/0, ::/0) 的 AWS EC2 安全组中的端口 8888

Then you can access jupyter using http://:8888然后你可以使用 http://:8888 访问 jupyter

Hope this helps.希望这可以帮助。

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

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