I am trying to connect Jupyter notebook to my GCP instance. After following some information on StackOverflow, I used-
nohup jupyter notebpook --ip=0.0.0.0 &
to run jupyter notebook in the background. And then tunneled by doing an SSH into GCP-
ssh username@<public_ip> -L 8888:127.0.0.1:8888
So, I can access Jupyter notebooks at 127.0.0.1:8888
Since most of these instructions were blindly followed off of a post, I'm a little lost on how nohup
actually works. I have the following questions -
Sorry for the extremely introductory questions. I appreciate all your help!
Running the process under nohup will keep it running even if you disconnect the ssh session. To kill it find it in the process list and kill:
killall jupyter
You can tell that you're running on the remote instance by looking at the environment from within a cell in a notebook. Just enter:
import os
print(os.environ)
You will be charged for the GCE instance as long as it's running. It doesn't matter whether jupyter is running or not. To stop the instance go into the GCP console, select the instance, and click Stop.