简体   繁体   English

在AWS EC2中安装Jupyter

[英]Installing Jupyter in AWS EC2

I have been following the steps below to install Jupyter in AWS EC2: https://chrisalbon.com/aws/basics/run_project_jupyter_on_amazon_ec2/ 我一直遵循以下步骤在AWS EC2中安装Jupyter: https ://chrisalbon.com/aws/basics/run_project_jupyter_on_amazon_ec2/

I gave 8888 as port. 我给了8888作为港口。 I then launched jupyter notebook: 然后,我启动了jupyter笔记本:

在此处输入图片说明

Then I go on my instance url: https://ec2-XX-XX-XX-XXX.eu-west-3.compute.amazonaws.com:8888/ 然后我继续输入我的实例网址: https ://ec2-XX-XX-XX-XXX.eu-west-3.compute.amazonaws.com: 8888/

I have a public IP so I also tried https://XX-XX-XX-XXX:8888/ 我有一个公共IP,所以我也尝试了https:// XX-XX-XX-XXX:8888 /

But it does not load anything in both ways. 但是,它不会同时以两种方式加载任何内容。 I made sure that 8888 port is authorized in security groups on my EC2 instance. 我确保在我的EC2实例上的安全组中授权了8888端口。 Any idea how I can deep dive where the issue is? 知道我该如何深入探讨问题所在吗?

[EDIT 1]: [编辑1]:

I followed these steps: 我按照以下步骤操作:

c = get_config()

# Kernel config
c.IPKernelApp.pylab = 'inline'  # if you want plotting support always in your notebook

# Notebook config
c.NotebookApp.certfile = u'/home/ec2-user/Notebooks/certs/Mycert_file.pem' #location of your certificate file
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False  #so that the ipython notebook does not opens up a browser by default
c.NotebookApp.password = u'sha1:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'  #the encrypted password we generated above
# Set the port to 8888, the port we set up in the AWS EC2 set-up
c.NotebookApp.port = 8888

[EDIT 2]: [编辑2]:

Previously to these steps I did this: 在执行这些步骤之前,我这样做是:

sudo openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout Mycert_file.pem -out Mycert_file.pem

Now, to locate my .pem file I did the following: find /home -name *.pem 现在,要查找我的.pem文件,请执行以下操作: find /home -name *.pem

I found the location of my .pem file which is /home/ec2-user/Notebooks/certs/Mycert_file.pem 我找到了.pem文件的位置,该文​​件是/home/ec2-user/Notebooks/certs/Mycert_file.pem

[EDIT 3]: [编辑3]:

I will also add that I am already currently running a RStudio session on this instance on a 8787 port. 我还要补充一点,我目前已经在8787端口上的此实例上运行RStudio会话。 I assume this is not impacting what I am doing trying to install Jupyter) but just wanted to point it out in case of. 我认为这不会影响我尝试安装Jupyter的工作,但只是想指出以防万一。

So I found the issue, regarding the config file. 因此,我发现了有关配置文件的问题。 In the tutorial it said to press esc key to record the config file. 在本教程中,它说要按esc键来记录配置文件。 But that was not saving the file for me. 但这并没有为我保存文件。 So I simply used :wq! 所以我只是用:wq! and it saved it for me. 它为我保存了它。

But I still can't make it work. 但是我仍然无法使它工作。 So, as advised, I used jupyter notebook --debug Here are the logs: 因此,按照建议,我使用了jupyter notebook --debug以下是日志: 在此处输入图片说明

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

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