Jupyter无法从Google Cloud运行

问题描述

大家好!

我已经使用Google云设置了VM,用于托管Jupyter Hub服务器。

我同时允许HTTP和HTTPS通信。我已经设置了防火墙以允许端口8888的IP范围为0.0.0.0/0。我已经将外部IP地址设为静态(也尝试过短暂使用)。

运行命令“ jupyter笔记本--ip = 0.0.0.0 --port = 8888 --no-browser&”时,Jupyter笔记本将通过以下命令成功启动:

[I 09:51:49.924 NotebookApp] Jupyter Notebook 6.1.1 is running at:
[I 09:51:49.924 NotebookApp] http://virtualpcname:8888/?token=xxxxx
[I 09:51:49.924 NotebookApp]  or http://localip:8888/?token=xxxxx
[I 09:51:49.924 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmatio
n).
[C 09:51:49.927 NotebookApp] 
    
    To access the notebook,open this file in a browser:
        file:///virtualmachinepath/.local/share/jupyter/runtime/nbserver-28710-open.html
    Or copy and paste one of these URLs:
        http://virtualpcname:8888/?token=xxxx
     or http://localip:8888/?token=xxxx

然后我将以下格式用于浏览器: http:// STATIC_EXTERNAL_IP:8888 /?token = xxxx

最后,我无法连接到服务器并获得经典的“无法访问此站点。连接超时”

我还为直接连接到Windows防火墙的端口8888的入站和出站连接添加了例外,关闭了防火墙并且仍然没有运气

似乎访问受到限制或阻止。我该如何解决?我也在两台单独的PC上尝试过

解决方法

我使用了一台n1-standard-8(8个vCPU,30 GB内存)的机器,配备2个NVIDIA Tesla K80 GPU。该图片是来自GCP公共图片列表的ubuntu-1604-xenial-v20200807。我在防火墙默认网络中为源过滤器(IP范围)0.0.0.0/0允许了5000个Ingress端口。我遵循public doc在Google Cloud Platform上安装Jupyter Notebook。根据{{​​3}}安装后,我运行了以下命令:

jupyter-notebook --no-browser --port = 5000

并浏览了像http:// External_IP:5000 /这样的外部静态IP,我成功了。根据我的观察,我们需要允许防火墙中的端口仔细访问正在运行服务的服务。

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...