Jupyter 远程访问

jupyter 远程访问的工作方法是,在本地通过浏览器打开jupyter,但是代码和服务运行在远程集群中。

集群设置

首先需要确保集群中安装有python和jupyter。

在集群 /opt/intel/2019 目录下,已经安装好python3和jupyter。将其添加入环境变量中

export PATH=/opt/intel/2019/intelpython3/bin:${PATH}

随后对python路径进行检查,可以看出此时已经在调用intel python。

$ which python
/opt/intel/2019/intelpython3/bin/python

随后用以下命令对 jupyter 进行设置,设置 jupyter 登录密码。

$ jupyter notebook --generate-config

$ jupyter notebook password
Enter password: ****
Verify password: ****

此时在个人目录下就生成了 jupyter 配置文件 jupyter_notebook_config.py

对配置文件进行修改,增加以下设置

c.NotebookApp.ip='*' # 星号代表任意ip,这个跟mysql的权限设置一样,所以说知识是互通的
c.NotebookApp.allow_remote_access = True # 允许远程连接
c.NotebookApp.password = u'sha1:xxx' # 复制密码在此
c.NotebookApp.open_browser = False # 不自动打开浏览器
c.NotebookApp.port = 6666 # 指定端口, 访问时使用

注意在设置端口时给定一个较大的整数,22 或 24 等常用端口时不可以的。

此时即可在命令行中启动jupyter notebook服务,会显示以下内容:

$ jupyter notebook
[W 14:01:28.051 NotebookApp] Collisions detected in /home/lilongxiang/.jupyter/jupyter_notebook_config.py and /home/lilongxiang/.jupyter/jupyter_notebook_config.json config files. /home/lilongxiang/.jupyter/jupyter_notebook_config.json has higher priority: {
"NotebookApp": {
"password": "'sha1:llx891209' ignored, using 'sha1:a221858aea95:923e3211599640af335a06052fcea5818f118621'"
}
}
[W 14:01:28.054 NotebookApp] Config option `allow_remote_access` not recognized by `NotebookApp`. Did you mean one of: `allow_credentials, allow_root`?
[W 14:01:28.206 NotebookApp] WARNING: The notebook server is listening on all IP addresses and not using encryption. This is not recommended.
[I 14:01:28.213 NotebookApp] Serving notebooks from local directory: /home/lilongxiang
[I 14:01:28.213 NotebookApp] 0 active kernels
[I 14:01:28.213 NotebookApp] The Jupyter Notebook is running at:
[I 14:01:28.213 NotebookApp] http://[all ip addresses on your system]:1224/
[I 14:01:28.213 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[I 14:01:41.532 NotebookApp] 302 GET / (10.155.11.18) 0.50ms

本地登录

注意上面内容中,提示可以使用任意ip地址登录Notebook服务。在本地网页浏览器中,以集群IP地址代替。如集群IP为10.166.15.60,在本地浏览器中输入

https://10.166.15.60:1224/

随后即可登录集群jupyter notebook服务进行操作。

最新文章

  1. 大话JS面向对象之开篇万物皆对象------(ATM取款机引发的深思)
  2. 【C#进阶系列】25 线程基础
  3. 电赛总结(三)——DA芯片总结
  4. SQLite(快速上手版)笔记
  5. hdu----(1075)What Are You Talking About(trie之查找)
  6. Tomcat 管理页面
  7. Java 方法覆盖和方法重载
  8. sqlmap批量扫描burpsuite请求日志记录
  9. 网站页面优化必然趋势—WebP 图片!
  10. POJ3026(BFS + prim)
  11. SQL Server 查看数据库空间分配情况的 2 种方法
  12. codeforces 887A Div. 64 思维 模拟
  13. jdk源码->集合->HashSet
  14. 来自后端的突袭? --浅尝最新开源的C# Web引擎 Blazor
  15. 第二章.python入门
  16. BZOJ2870 最长道路
  17. Codeforces 977D: Divide by three, multiply by two(暴力)
  18. spring cloud(学习笔记) Enreka服务治理
  19. Jquery框架1.选择器|效果图|属性、文档操作
  20. C++学习(三十二)(C语言部分)之 栈

热门文章

  1. 关于ORBSLAM的发展脉络
  2. oracle物化视图创建及删除
  3. C++STL(set……)
  4. 求树的直径【两遍BFS】
  5. CSP2020-儒略历
  6. 输入指令npx webpack-dev-server报错:Error: Cannot find module ‘webpack-cli/bin/config-yargs‘的解决方法
  7. redis批量操作
  8. dart系列之:dart语言中的异常
  9. redis如何解决key冲突?
  10. MySQL基础语句(MySQL内置函数 )