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

查看:35
本文介绍了为什么我无法访问远程 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 = '*' #允许所有来源

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

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

c.NotebookApp.ip = '0.0.0.0' # 监听所有 IP

另请参阅此线程的后续答案中的详细信息.

Also see the details in a subsequent answer in this thread.

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

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

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