本文介绍了jupyter 抛出错误:socket.gaierror: [Errno -2] 名称或服务未知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 AWS EMR 上运行了一个 pyspark 集群,并使用 Jupyter 来运行 pyspark 驱动程序.最近,脚本失败了.Jupiter 无法启动服务器.我用 conda install jupyter 安装,并从 sudo initctl start jupyter 开始.集群运行良好.这是服务器的配置值.

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

推荐答案

我发现在更新到 jupyter 5.7 之后.我不得不修改配置参数.改变

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

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

这篇关于jupyter 抛出错误:socket.gaierror: [Errno -2] 名称或服务未知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-29 18:10