jupyter配置说明

使用以下命令修改jupyter的配置文件参数:

bash 复制代码
vim /root/.jupyter/jupyter_lab_config.py 
bash 复制代码
#这里填写远程访问的IP名,填*则默认是主机IP名
c.ServerApp.ip = '*'
# 这里的密码填写上面生成的密钥
c.ServerApp.password = '************************************************'
# 禁止用host的浏览器打开jupyter
c.ServerApp.open_browser = False
# 打开jupyter lab的端口,端口自定义
c.ServerApp.port = 8888
# 允许远程访问 
c.ServerApp.allow_remote_access = True
# jupyter lab工作文件的路径
c.ServerApp.root_dir = '/path'
# IOPub数据通道的最大数据传输速率
c.ServerApp.iopub_data_rate_limit = 100000000000
# 数据传输速率的时间窗口
c.ServerApp.rate_limit_window = 10000000
# 跨站请求伪造(Cross-Site Request Forgery, XSRF)保护的启用或禁用
c.ServerApp.disable_check_xsrf = True
# kernel是否自动重启
c.KernelManager.autorestart = True
# 是否运行修改密码
c.ServerApp.allow_password_change = True
# 是否有退出按钮
c.ServerApp.quit_button = True
# 长时间不允许自动停止
c.ServerApp.shutdown_no_activity_timeout = 0
# 启动terminal
c.ServerApp.terminals_enabled = True
# terminal路径
c.ServerApp.terminado_settings = {'shell_command' : ['/bin/bash']}
# 是否允许root运行
c.ServerApp.allow_root = True
# memory监控
c.ResourceUseDisplay.mem_limit = 32*1024*1024*1024
# cpu监控
c.ResourceUseDisplay.track_cpu_percent = True
# cpu核数
c.ResourceUseDisplay.cpu_limit = 16

这些参数是在Jupyter Notebook或Jupyter Lab的配置文件中使用的,用来自定义服务器的行为和特性。下面是每个参数的解释:

c.ServerApp.ip = '*'

作用: 设置服务器监听的IP地址。

值: '*' 表示接受所有IP地址的连接,使得Jupyter服务器可以从任何机器上访问。

c.ServerApp.password

作用: 设置用于访问Jupyter服务器的加密密码。

值: 通常是一个加密的哈希值,出于安全考虑不应直接以明文形式显示。

c.ServerApp.open_browser = False

作用: 控制启动Jupyter服务器时是否自动打开浏览器。

值: False 表示不自动打开浏览器。

c.ServerApp.port = 8888

作用: 指定服务器监听的端口号。

值: 8888 是Jupyter的默认端口。

c.ServerApp.allow_remote_access = True

作用: 是否允许远程访问。

值: True 表示允许从非本机地址访问Jupyter服务器。

c.ServerApp.root_dir = '/path'

作用: 设置Jupyter Lab的根目录。

值: '/path' 应该替换为你希望作为Jupyter工作空间的目录路径。

c.ServerApp.iopub_data_rate_limit = 100000000000

作用: 设置IOPub数据通道的最大数据传输速率。

c.ServerApp.rate_limit_window = 10000000

作用: 定义计算数据传输速率的时间窗口。

c.ServerApp.disable_check_xsrf = True

作用: 是否禁用跨站请求伪造保护。

c.KernelManager.autorestart = True

作用: 设置是否自动重启内核。

值: True 表示如果一个内核崩溃,它会自动重启。

c.ServerApp.allow_password_change = True

作用: 允许用户更改密码。

值: True 表示用户可以更改Jupyter服务器的密码。

c.ServerApp.quit_button = True

作用: 是否在Jupyter界面显示退出按钮。

值: True 表示显示退出按钮。

c.ServerApp.shutdown_no_activity_timeout = 0

作用: 在没有活动的情况下自动关闭服务器的超时时间。

值: 0 表示不自动关闭。

c.ServerApp.terminals_enabled = True

作用: 是否启用终端。

值: True 表示允许用户通过Jupyter访问系统终端。

c.ServerApp.terminado_settings = {'shell_command' : ['/bin/bash']}

作用: 设置终端使用的命令。

值: 在这个例子中,使用/bin/bash作为终端的默认shell。

c.ServerApp.allow_root = True

作用: 是否允许以root用户运行。

值: True 表示允许以root用户身份运行Jupyter服务器。

c.ResourceUseDisplay.mem_limit = 32*1024*1024*1024

作用: 设置Jupyter Notebook界面显示的内存使用限制。

值: 在这个例子中,内存限制被设置为32GB。

c.ResourceUseDisplay.track_cpu_percent = True

作用: 是否在Jupyter Notebook界面跟踪和显示CPU使用百分比。

值: True

相关推荐
前端无涯37 分钟前
Trae的使用
前端·ide·trae
Sleepy MargulisItG1 小时前
【Linux网络编程】应用层协议:HTTP协议
linux·服务器·网络·http
G31135422731 小时前
Linux 内核设计中的核心思想与架构原则
linux·架构·php
zhuzewennamoamtf1 小时前
Linux内核platform抽象、数据结构、内核匹配机制
linux·运维·数据结构
少吃零食多运动2 小时前
【Jupyter notebook修改工作目录】
python·jupyter
Kira Skyler3 小时前
ELF文件解析 elf.o 文件主要内容.md
linux
逐梦吧!旅行者3 小时前
Linux MySQL 5.7用户管理与用户密码的设置问题
linux·mysql
RisunJan3 小时前
Linux命令-grpck命令(验证和修复组配置文件(`/etc/group` 和 `/etc/gshadow`)完整性的工具)
linux·运维·服务器
loosed3 小时前
Ubuntu mysql8 tar.xz 安装
linux·ubuntu·adb
Xの哲學3 小时前
Linux VxLAN深度解析: 从数据平面到内核实现的全面剖析
linux·服务器·算法·架构·边缘计算