Google compute engine 如何在gcloud计算引擎中启动jupyter笔记本

Google compute engine 如何在gcloud计算引擎中启动jupyter笔记本,google-compute-engine,jupyter-notebook,Google Compute Engine,Jupyter Notebook,我想使用谷歌云计算引擎的jupyter笔记本。当我试图通过命令行启动它时,我无法使用浏览器打开笔记本 请告诉我怎么做 看起来您正试图在虚拟机上启动Jupyter笔记本服务器,并希望使用虚拟机的外部IP访问它,前提是您尚未禁用虚拟机上的外部IP选项 您需要执行以下操作: # Set options for certfile, ip, password, and toggle off # browser auto-opening c.NotebookApp.certfile = u'/absolut

我想使用谷歌云计算引擎的jupyter笔记本。当我试图通过命令行启动它时,我无法使用浏览器打开笔记本


请告诉我怎么做

看起来您正试图在虚拟机上启动Jupyter笔记本服务器,并希望使用虚拟机的外部IP访问它,前提是您尚未禁用虚拟机上的外部IP选项

您需要执行以下操作:

# Set options for certfile, ip, password, and toggle off
# browser auto-opening
c.NotebookApp.certfile = u'/absolute/path/to/your/certificate/mycert.pem'
c.NotebookApp.keyfile = u'/absolute/path/to/your/certificate/mykey.key'
# Set ip to '*' to bind on all interfaces (ips) for the public server
c.NotebookApp.ip = '*'
c.NotebookApp.password = u'sha1:bcd259ccf...<your hashed password here>'
c.NotebookApp.open_browser = False

# It is a good idea to set a known, fixed port for server access
c.NotebookApp.port = 9999
在~/.jupyter目录中修改jupyter_notebook_config.py。由于Jupyter笔记本默认情况下只侦听环回接口,即127.0.0.1 aka localhost,因此请务必仔细阅读并了解如何执行。 您应该取消注释并删除的最小配置选项集 jupyter_notebook_config.py中的编辑如下:

# Set options for certfile, ip, password, and toggle off
# browser auto-opening
c.NotebookApp.certfile = u'/absolute/path/to/your/certificate/mycert.pem'
c.NotebookApp.keyfile = u'/absolute/path/to/your/certificate/mykey.key'
# Set ip to '*' to bind on all interfaces (ips) for the public server
c.NotebookApp.ip = '*'
c.NotebookApp.password = u'sha1:bcd259ccf...<your hashed password here>'
c.NotebookApp.open_browser = False

# It is a good idea to set a known, fixed port for server access
c.NotebookApp.port = 9999
更改可能需要几秒钟到几分钟才能生效


或者,您也可以使用而不是gcloud来配置防火墙规则。您可以详细阅读其中的说明。

您还可以创建防火墙规则以允许您的jupyter c.NotebookApp.port号。 将协议和端口设置为tcp: