从远程服务器永久使用Jupyter Notebook [英] Persistent use of Jupyter Notebook from remote server
本文介绍了从远程服务器永久使用Jupyter Notebook的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用ssh -L
连接到远程服务器,但是如果我关闭笔记本电脑盖或连接断开,则jupyter笔记本电脑将断开连接.
I connect to a remote server using ssh -L
but if I close the laptop lid or the connection is lost, the jupyter notebook is disconnected.
重新连接到远程服务器后,最后一个"会话丢失.
After I reconnect to the remote server, the "last" session is lost.
如何使它持久化?
screen
可以帮忙吗?
What can be done to make it persistent?
Could screen
help with it?
推荐答案
在远程服务器上,您应该在screen
会话中打开jupyter,如果您失去与服务器的连接并恢复它,它将使其保持持久状态
On the remote server, you should open your jupyter in a screen
session, it will make it persistent if you lose the connection to the server and resume it.
- 在您的计算机上:
ssh -L xxxx:localhost:yyyy server
. -
screen
. -
jupyter notebook --no-browser --port=yyyy
. - 在浏览器中:
localhost:xxxx
.
- On your computer:
ssh -L xxxx:localhost:yyyy server
. screen
.jupyter notebook --no-browser --port=yyyy
.- In your browser:
localhost:xxxx
.
要手动断开连接并重新连接:
To disconnect manually and reconnect:
- 退出屏幕窗口:
control + a
,然后再d
. - 断开与服务器的连接:
control + d
- 然后重新连接
ssh -L xxxx:localhost:yyyy
. - (可选)您可以使用
screen -r
重新打开屏幕窗口,尽管不必要. - 返回笔记本或重新打开
localhost:xxxx
.
- Exit the screen window:
control + a
and thend
. - Disconnect from the server:
control + d
- And reconnect
ssh -L xxxx:localhost:yyyy
. - Optionally, you can reopen the screen window, though unnecessary, using
screen -r
. - Go back to your notebook or reopen
localhost:xxxx
.
这篇关于从远程服务器永久使用Jupyter Notebook的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文