为什么我无法访问远程Jupyter Notebook服务器? [英] Why I can't access remote Jupyter Notebook server?

查看:808
本文介绍了为什么我无法访问远程Jupyter Notebook服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在我的centos6.5服务器上启动了Jupyter Notebook服务器,而jupyter的运行方式就像

I have started a Jupyter Notebook server on my centos6.5 server.And jupyter is running like

[I 17:40:59.649 NotebookApp] Serving notebooks from local directory: /root
[I 17:40:59.649 NotebookApp] 0 active kernels 
[I 17:40:59.649 NotebookApp] The Jupyter Notebook is running at:https://[all ip addresses on your system]:8045/
[I 17:40:59.649 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).

当我想在同一局域网中远程访问Jupyter时,说打开http://192.168.1.111:8045/,我根本无法打开Jupyter页面.顺便说一句,我可以成功访问远程centos服务器.

When I want to access Jupyter remotely in the same local area network, say open http://192.168.1.111:8045/, I can't open a Jupyter page at all. By the way, I can access remote centos server successfully.

可能的原因是什么?

推荐答案

您是否已将 jupyter_notebook_config.py 文件配置为允许外部连接?

Have you configured the jupyter_notebook_config.py file to allow external connections?

默认情况下,Jupyter Notebook仅接受来自本地主机的连接(例如,从其运行所在的同一台计算机).通过将 NotebookApp.allow_origin 选项从默认的''修改为'*',您可以从外部访问Jupyter.

By default, Jupyter Notebook only accepts connections from localhost (eg, from the same computer that its running on). By modifying the NotebookApp.allow_origin option from the default ' ' to '*', you allow Jupyter to be accessed externally.

c.NotebookApp.allow_origin = '*' #allow all origins

您还需要更改笔记本计算机将侦听的IP:

You'll also need to change the IPs that the notebook will listen on:

c.NotebookApp.ip = '0.0.0.0' # listen on all IPs


有关Jupyter Notebook配置文件的文档.

这篇关于为什么我无法访问远程Jupyter Notebook服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆