gpt4 book ai didi

docker - 在Jupyter docker中,无法连接到内核

转载 作者:行者123 更新时间:2023-12-02 20:29:51 30 4
gpt4 key购买 nike

在安装Jupyter docker 时,例如以下示例:

docker run -d \
--hostname jupyterhub-ds \
--log-opt max-size=50m \
-p 8000:8000 \
-p 5006:5006 \
-e DOCKER_USER=$(id -un) \
-e DOCKER_USER_ID=$(id -u) \
-e DOCKER_PASSWORD=$(id -un) \
-e DOCKER_GROUP_ID=$(id -g) \
-e DOCKER_ADMIN_USER=$(id -un) \
-v "$(pwd)":/workdir \
-v "$(dirname $HOME)":/home_host \
dclong/jupyterhub-ds /scripts/sys/init.sh

JupyterLab启动良好,我进入了实验室。通过URL +端口。
但是,这不可能连接到内部python内核(连接已挂起)。

我要面对什么样的安全性?
这与套接字通信的安全性有关吗?

经过调查,我收到了以下消息:
[D 16:01:39.488 NotebookApp] Starting kernel: ['/usr/local/bin/python', '-m', 'ipykernel_launcher', '-f', '/root/.local/share/jupyter/runtime/kernel-f0420fbf-12e918f-20df7d3e804a.json']
[D 16:01:39.491 NotebookApp] Connecting to: tcp://127.0.0.1:51775
[D 16:01:39.491 NotebookApp] Connecting to: tcp://127.0.0.1:38609
[I 16:01:39.492 NotebookApp] Kernel started: f0420fbf-12ef-403e-918f-20df7d3e804a
[D 16:01:39.492 NotebookApp] Kernel args: {'kernel_name': 'python3', 'cwd': '/'}
[D 16:01:39.493 NotebookApp] Clearing buffer for 5e93046f-aa3e-4edd-a018-66b9d4c752e5
[I 16:01:39.493 NotebookApp] Kernel shutdown: 5e93046f-aa3e-4edd-a018-66b9d4c752e5

似乎与此相关:
https://jupyter-notebook.readthedocs.io/en/stable/public_server.html
        Firewall Setup
To function correctly, the firewall on the computer running the jupyter notebook server must be configured to allow connections from client machines
on the access port c.NotebookApp.port set in jupyter_notebook_config.py to allow connections to the web interface.

The firewall must also allow connections from 127.0.0.1 (localhost) on ports from 49152 to 65535. These ports are used by the server to communicate with the notebook kernels.

The kernel communication ports are chosen randomly by ZeroMQ,

并且每个内核可能需要多个连接,因此必须可以访问大量端口。

最佳答案

我不确定如何构建docker命令,或者为什么选择特定的Docker镜像dclong / jupyterhub?

如果它旨在运行jupyterhub(多用户),那么,如果您想在docker中运行自己的Jupyter服务器,那听起来就不是您所需要的,只是为您而已。

我建议使用像jupyter/scipy-notebook这样的东西代替,它只是为了运行一个Jupyter服务器而设计。

否则,请描述您实际想要运行的内容,或者为什么您认为需要使用该镜像等。

关于docker - 在Jupyter docker中,无法连接到内核,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62146653/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com