2017-04-05 210 views
8

我在AWS EC2實例上運行Ubuntu 14.04 LTS。 我試圖從我的MacBookPro連接到Safari中的Jypter。 我在我的安全組中打開了https端口443和TCP 8888。無法連接到AWS EC2實例上的Jupyter Notebook

我無法從我的Mac上的Safari瀏覽器連接到Jupyter。 (我可以通過端口6006連接到Tensorboard)。

[email protected]:~$ 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 
+0

你找到一個解決方案訪問它?也有這個麻煩。我在ec2控制檯中打開了端口443和8888,但我仍然遇到麻煩。 –

回答

1

好吧,發現問題:

編輯您的jupyter配置:

jupyter notebook --generate-config 

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

確保

c.NotebookApp.ip = '*' 

還要確保您在EC2服務器中打開了相關的安全組(fo R實施例8888端口)

運行Jupyter:

jupyter notebook 

現在,您可以遠程使用正確的端口