从远程服务器持续使用 Jupyter Notebook [英] Persistent use of Jupyter Notebook from remote server

查看:53
本文介绍了从远程服务器持续使用 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.

  1. 在您的计算机上:ssh -L xxxx:localhost:yyyy server.
  2. 屏幕.
  3. jupyter notebook --no-browser --port=yyyy.[在远程服务器上]
  4. 在浏览器中:localhost:xxxx.
  1. On your computer: ssh -L xxxx:localhost:yyyy server.
  2. screen.
  3. jupyter notebook --no-browser --port=yyyy. [on remote server]
  4. In your browser: localhost:xxxx.

手动断开连接并重新连接:

To disconnect manually and reconnect:

  1. 退出屏幕窗口:control + a 然后d.
  2. 断开与服务器的连接:control + d
  3. 并重新连接ssh -L xxxx:localhost:yyyy.
  4. 或者,您可以使用 screen -r 重新打开屏幕窗口,尽管这是不必要的.
  5. 返回到您的笔记本或重新打开 localhost:xxxx.
  1. Exit the screen window: control + a and then d.
  2. Disconnect from the server: control + d
  3. And reconnect ssh -L xxxx:localhost:yyyy.
  4. Optionally, you can reopen the screen window, though unnecessary, using screen -r.
  5. Go back to your notebook or reopen localhost:xxxx.

这篇关于从远程服务器持续使用 Jupyter Notebook的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆