Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jupyter throwing error: socket.gaierror: [Errno -2] Name or service not known

I run a pyspark cluster on AWS EMR and use Jupyter to the pyspark driver. Recently, the script failed. Jupiter fails to start a server. I install with conda install jupyter and start with sudo initctl start jupyter. The cluster runs fine. Here are the config values of the server.

# jupyter configs
mkdir -p ~/.jupyter
touch ls ~/.jupyter/jupyter_notebook_config.py
HASHED_PASSWORD=$(python -c "from notebook.auth import passwd; 
print(passwd('$JUPYTER_PASSWORD'))")
echo "c.NotebookApp.password = u'$HASHED_PASSWORD'" >> ~/.jupyter/jupyter_notebook_config.py
echo "c.NotebookApp.open_browser = False" >> ~/.jupyter/jupyter_notebook_config.py
echo "c.NotebookApp.ip = '*'" >> ~/.jupyter/jupyter_notebook_config.py
echo "c.NotebookApp.notebook_dir = '/mnt/$BUCKET/$FOLDER'" >> ~/.jupyter/jupyter_notebook_config.py
echo "c.ContentsManager.checkpoints_kwargs = {'root_dir': '.checkpoints'}" >> ~/.jupyter/jupyter_notebook_config.py
echo "c.NotebookApp.port = 8080" >> ~/.jupyter/jupyter_notebook_config.py
like image 426
Michael Hoffman Avatar asked Oct 08 '18 16:10

Michael Hoffman


1 Answers

I found that after the update to jupyter 5.7. I had to modify the config parameters. Change

echo "c.NotebookApp.ip = '*'" >> ~/.jupyter/jupyter_notebook_config.py

to

echo "c.NotebookApp.ip = '0.0.0.0'" >> ~/.jupyter/jupyter_notebook_config.py
like image 171
Michael Hoffman Avatar answered Sep 28 '22 10:09

Michael Hoffman