2017-04-05 3 views
8

Ich verwende Ubuntu 14.04 LTS auf einer AWS EC2-Instanz. Ich versuche, eine Verbindung zu Jypter in Safari von meinem MacBookPro herzustellen. Ich öffnete https Port 443 und TCP 8888 in meiner Sicherheitsgruppe.Verbindung mit Jupyter Notebook auf AWS EC2-Instanz nicht möglich

Ich kann keine Verbindung zu Jupyter von meinem Safari-Browser auf meinem Mac herstellen. (Ich kann an Tensorboard an Port 6006 anschließen).

[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

Sie eine Lösung gefunden? Auch Probleme damit. Ich habe die Ports 443 und 8888 in der ec2-Konsole geöffnet, aber ich habe immer noch Probleme. –

Antwort

4

Für mich SSH-Tunneling für solche Fälle funktioniert gut.

ssh -i /path/to/your/AWS/key/file -NL 8157:localhost:8888 [email protected] 

wo Benutzer und Host von Ihrer ec2-Instanz abhängen. Danach

können Sie http://localhost:8157/

+0

Ehrfürchtig. Das funktioniert. Danke :) – Dawny33

+0

Großartig! Danke für das Teilen ... – petezurich

1

Gut finden, um das Problem gefunden:

Bearbeiten Sie Ihre jupyter Konfiguration:

jupyter notebook --generate-config 

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

Vergewissern Sie sich, dass

c.NotebookApp.ip = '*' 

Auch stellen Sie sicher, Sie haben die relevante Sicherheitsgruppe in Ihrem EC2-Server geöffnet (z. B. r Beispiel Port 8888)

Run Jupyter:

jupyter notebook 

Jetzt können Sie es per Fernzugriff mit dem richtigen Port