I am trying to open on my local browser the Jupyter notebook opened through the AWS instance.
I am using m4.2xlarge instance from the ami-d36386aa, Ireland region.
I then typed inside the instance command line:
jupyter notebook --no-browser --ip=xx.xx.xx.xx
Where the ip is the public ip from AWS.
run Jupyter notebook
given output:
http://ec2-xx-xxx-x-xxx.eu-west-1.compute.amazonaws.com:8888/?token=....
I copied the output from (2) to my browser but nothing is happening.
Any suggestions?
Related
Let me give the necessary context:
Security group details for Instance:
Jupyter Notebook Config File Snapshot:
When I run jupyter notebook this is what I get
And I cant connect to the Instance as I am getting this error:
Not sure what I am missing out or doing wrong. Any help would be appreciated.
You can run it in a headless mode, without browser:
jupyter notebook --no-browser
Then you can access it from your local workstation. Preferably over ssh tunnel for security reasons, rather then directly.
I am a beginner for Amazon Ec2 and recently I successfully ssh to EC2 instance. yet when I tried to activate jupyter before ssh:
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. How could I proceed to 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. So change the server name to IP address of your EC2 instance (assuming you allowed traffic on correct ports)
There are a few guides how to access jupyter notebooks on remote servers, e. g. see
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 :
c.NotebookApp.ip = '*'
You can start the jupyter server using the following command:-
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)
Then you can access jupyter using http://:8888
Hope this helps.
I am having trouble setting up Jupyter Notebook in my EC2 Instance (Deep Learning AMI Linux). I followed the tutorial from this link. Imanaged to finish all without any problems except launching the notebook. In the SSH terminal, after I inputed the jupyter notebook command, it says my notebook is running in https://ip-172-*-*-*:8888/, but when I opened that link, it just says the site can't be reached. Same problem when I inputed my instance's public DNS with :8888 at the end.
Can someone tell my what I might be doing wrong?
Please help. Thank you in advance!
I havae found the solution, it turns out the links didn't specify that the EC2 instance has to allow HTTPS connection. So, I added a Custom TCP Rule, with prot range 443, and Souce 0.0.0.0/0 to the security group.
I can suggest you the following procedure:
jupyter notebook --ip=0.0.0.0 --no-browser
Access jupyter notebook index from your web-browser by visiting:
<IPv4 public IP address displayed on EC2 Dashboard> :8888/?token=...
Hope this helps.
I am working on a project in an EC2 isntance using jupyter notebook. It seems like jupyter notebook does not allow multiple ssh to its server at the same time, I have to log out if other people want to connect to jupyter notebook through the instance. Is it possible to make multiple access to jupyter notebook from the same instance?
Create/update jupyter_notebook_config.py file in ~/.jupyter folder with the below code. All jupyter notebook command calls post this file creation will infer configuration from the file.
from notebook.auth import passwd
c = get_config()
c.NotebookApp.open_browser=False
c.NotebookApp.ip='*' # Allows access from anywhere
c.NotebookApp.port=8885 # Jupyter runs in port 8885
c.NotebookApp.password=passwd('jupyter') # Password to access notebooks
Make sure you've opened 8885 (or any other port of your choice mentioned in the configuration file) allows connection requests from outside (update EC2 security groups appropriately). Not sure if you've tried this or what the issue at your end is but this works for me.
The juypter notebook is installed on a server in this case an EC2 machine.
Any number of people can SSH into this machine if they have the credentials using putty or some ssh client, this has no connection with jupyter notebook.
(assuming that the SSH port 22 is open for the other users and they are able to connect)
When you launch the jupyter notebook using the jupyter notebook command -> you start a local instance of the jupyter notebook on the default port (maybe 8888)
you will have a URL for this notebook interface and you can work on it.
Important to note -> This is a local instance of your notebook. It is not public and can only be accessed on your OS username as a localhost.
If other OS users run the jupyter notebook command they will get their local version of the notebook on a different port (maybe 8889 by default as the port number 8888 is already in use by you )
You can make your notebook public and then you will get a public URL for your notebook (serverip:8888 or the port you have specified)
This public link can be shared with others. Now multiple people have visibility to your notebook and can edit code in your notebook.
p.s -> for public notebooks the port in which you are running the notebook needs to accept connections from AWS end. This can be configured in AWS console under the security groups tab
I am new to spark and AWS, I am trying to install Jupyter on my Spark cluster (EMR), i am not able to open Jupyter Notebook on my browser in the end.
Context: I have firewall issues from the place i am working, i can't get access to the EMR clsuter's IP address i create on a day-to-day basis. I have a dedicated EC-2 instance (IP address for this instance is white listed) that i am using as a client to connect to the EMR cluster i create on a need basis.
I have access to the IP address of the EC2 instance and the ports 22 and 8080.
I do not have access to the IP address of EMR cluster.
Following are the steps that i am following:
Open putty and connect to the EC2 instance
Establish connection between my EC2 instance and EMR cluster
ssh -i publickey.pem ec2-user#host name of the EMR cluster
install jupyter on the spark cluster using the following command:
pip install jupyter
Connect to spark:
PYSPARK_DRIVER_PYTHON=/usr/local/bin/jupyter PYSPARK_DRIVER_PYTHON_OPTS="notebook --no-browser --port=7777" pyspark --packages com.databricks:spark-csv_2.10:1.1.0 --master spark://127.0.0.1:7077 --executor-memory 6400M --driver-memory 6400M
Establish a tunnel to browser:
ssh -L 0.0.0.0:8080:127.0.0.1:7777 ip-172-31-34-209 -i publickey.pem
open Jupyter on browser:
http://host name of EMR cluster:8080
I am able to run the first 5 steps, but not able to open the Jupyter notebook on my browser.
Didn't test it, as it involves setting up a test EMR server, but here's what should work:
Step 5:
ssh -i publickkey.pem -L 8080:127.0.0.1:7777 HOSTNAME
Step 6:
Open jupyter notebook on browser using 127.0.0.1:8080
You can use an EMR notebook with Amazon EMR clusters running Apache Spark to remotely run queries and code. An EMR notebook is a "serverless" Jupyter notebook. EMR notebook sits outside the cluster and takes care of cluster attachment without you having to worry about it.
More information here: https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-managed-notebooks.html