问题描述
我有一个运行在AWS VPN上的Ipython Jupyter内核,该内核通过隧道连接到我的笔记本电脑上的端口,并通过浏览器连接到该端口.我发现只要丢失隧道,内核就会死亡而且我必须从头开始运行笔记本电脑.
I have an Ipython Jupyter kernel running on in an AWS VPN that I tunnel to a port my laptop where I connect to with a browser. I am finding that the kernel dies whenever I lose the tunneland I have to run my notebook from the beginning.
可能的原因是什么?如何预防?
What is the likely cause of this and how can I prevent it?
只有笔记本内核死了,笔记本服务器保持运行状态.
It is only the notebook kernels that die, the notebook server stays up.
推荐答案
我承认这似乎很奇怪.我想知道笔记本中是否有某些东西正在杀死内核.这可能发生.您可能已经完成了此操作,但是尝试使用一个非常简单的笔记本(例如a=10
),断开连接,然后在重新连接后查看是否可以print(a)
.
I admit that this seems odd. I wonder if there is something in the notebook that is killing the kernel. This can happen. You may have already done this, but try a really simple notebook, like a=10
, drop the connection, and then see if you can print(a)
after you recoennect.
但是,完全避免该问题的方法是使用屏幕或 tmux 创建持久的sshs会话.这就是许多在远程服务器上工作的人所做的事情.
However, the way to avoid the problem altogether is to use screen or tmux to create persistent sshs session. That is what many people who work on remote servers do.
这篇关于丢失Jupyter Notebook SSH连接会杀死内核的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!