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

查看:374
本文介绍了从远程服务器永久使用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. screen.
  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.
  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天全站免登陆