zoukankan      html  css  js  c++  java
  • ubantu 配置远程连接jupyter lab/notebook 后台挂起

    1、服务器安装JupyterLab
    这里推荐直接安装Anaconda,安装好后可以通过命令jupyter lab打开测试一下。

    2、生成配置文件

    $jupyter notebook --generate-config

    生成密码 此处的密码可由自己随意设定 保存好 返回的sha1字符串
    $ python
    Python 3.7.3 (default, Mar 27 2019, 22:11:17)
    [GCC 7.3.0] :: Anaconda, Inc. on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from notebook.auth import passwd
    >>> passwd()
    Enter password:
    Verify password:
    'sha1:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'

    4. 修改默认配置文件
    $vim ~/.jupyter/jupyter_notebook_config.py'

    # 将ip设置为*,意味允许任何IP访问
    c.NotebookApp.ip = ‘*# 这里的密码就是上边我们生成的那一串
    c.NotebookApp.password = ‘sha1:f704b702aea2:01e2bd991f9c7208ba177b46f4d10b6907810927‘ 
    # 服务器上并没有浏览器可以供Jupyter打开 
    c.NotebookApp.open_browser = False 
    # 监听端口设置为8888或其他自己喜欢的端口 
    c.NotebookApp.port = 8888
    # 允许远程访问 
    c.NotebookApp.allow_remote_access = True
    c.NotebookApp.notebook_dir = '默认打开目录'

    5.后台运行: nohup jupyter notebook --allow-root > jupyter.log 2>&1 &

     关闭:

    ps -ef | grep jupyter

    kill -9 ID

     
  • 相关阅读:
    AOP
    资料
    有用快捷键
    Java中getResourceAsStream的用法
    【转载】URL编码与两次encodeURI
    maven 如何使用
    MyEclipse运行Java出错:could not find the main class:test.program will exit(导入项目)
    java集合的操作(set,Iterator)
    java类集框架(ArrayList,LinkedList,Vector区别)
    java线程控制安全
  • 原文地址:https://www.cnblogs.com/zzuuoo666/p/13884503.html
Copyright © 2011-2022 走看看