当前位置:网站首页>Jupyter remote server configuration and server startup
Jupyter remote server configuration and server startup
2022-07-03 08:19:00 【qq_ forty-three million thirty-one thousand two hundred and thi】
One 、anaconda install
1、 download anaconda Installation package
[ Tsinghua mirror network ](https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/)`
2、 Command to install
bash Anaconda3-5.2.0-Linux-x86_64.sh
pip install jupyterlab
Two 、 To configure jupyter
1、 Generate configuration files
a. jupyter --paths
see .jupyter Is there any jupyter_notebook_config.py,
without ,shell function
jupyter notebook --generate-config( Generate jupyter_notebook_config.py, After the command is executed, the corresponding file path will be displayed )
b. vim jupyter_notebook_config.py( Modify the configuration )
2、 Configuration file modification
2.1 password Generate
# ipython Enter code line , Enter the following two lines of code and the corresponding password to generate the secret
(dev37) [email protected]-192-168-0-35 project % ipython
Python 3.7.12 | packaged by conda-forge | (default, Oct 26 2021, 05:59:23)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.33.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: from notebook.auth import passwd
...: passwd()
Enter password:
Verify password:
Out[1]: 'argon2:$argon2id$v=19$m=10240,t=10,p=8$RPFTJPYMgIgpj9OaLZQ9Dg$81axqbnxoIBCwgxy2SGqdPp7nBM+0ab16oBJkp1bA/A'
2.2 jupyter_notebook_config.py Relevant contents modified in
# Nginx Cross domain access will occur when accessing , It needs to be allowed here
c.NotebookApp.allow_origin = '*'
# It is forbidden to change the password at will
c.NotebookApp.allow_password_change = False
# Whether remote access is allowed
c.NotebookApp.allow_remote_access = True
# IP
c.NotebookApp.ip = '0.0.0.0'
# port
c.NotebookApp.port = 9820
# working directory
c.NotebookApp.notebook_dir = '/jupyter/'
# start-up Jupyter Notebook Whether to open the browser later
c.NotebookApp.open_browser = False
# Client open Jupyter Notebook Password hash value for
c.NotebookApp.password = 'sha1:7e9d8d4722c3:aa0a16fcf06b44ecbf208a3172af65f4d57163da'
3、 start-up
# Specify the profile path : /home/ubuntu/.jupyter/jupyter_lab_config.py: Change to your own configuration file path
nohup jupyter-lab --config /home/ubuntu/.jupyter/jupyter_lab_config.py --allow-root>/mnt/sdma/jupyter/develop37.txt>/mnt/sdma/jupyter/develop37_jupyter.txt 2>&1 &
3、 ... and 、 Configure power on self start
1、 Write self startup script
#!/bin/bash
nohup /home/ubuntu/anaconda3/envs/develop37/bin/jupyter-lab --config /home/ubuntu/.jupyter/jupyter_lab_config.py --allow-root>/mnt/sdma/jupyter/develop37.txt>/mnt/sdma/jupyter/develop37_jupyter.txt 2>&1 &
2、 Develop self starting Services ( The path of self starting service : linux The server is usually this path :/etc/systemd/system/)
[Unit]
Description=jupyter-lab
After=network.target
[Service]
ExecStart=/opt/jupyter.sh
[Install]
WantedBy=multi-user.target
( 3、 ... and .1 The self starting script in has been added #!/bin/bash, all ExecStart Direct file full path to start )
2.1 Self starting service content explanation :
[Unit]: Description of the service
Description: Describe the service
After: Describe the service category
[Service] Setting of service running parameters
Type=forking It's in the form of background operation
ExecStart Run the command for the service
ExecReload Restart command for service
ExecStop Stop command for service
PrivateTmp=True Indicates that a service is assigned a separate temporary space
Be careful : start-up 、 restart 、 All stop commands require absolute paths
3、 Start and view status
systemctl enable rc-local
systemctl start rc-local.service # Start the service
systemctl stop rc-local.service # Temporarily Out of Service
systemctl status rc-local.service # Check the status
systemctl daemon-reload # Reload the self starting service
If the implementation is successful, it will be shown as follows
4、 If the state is not success, It means that the self starting service has bug, The approximate rate is ExecStart There is a problem with the startup command
边栏推荐
- Youyou1 of xlua knapsack system
- the installer has encountered an unexpected error installing this package
- 【K&R】中文第二版 个人题解 Chapter1
- Puhua PLM empowers the whole scene product lifecycle management and helps the enterprise digital transformation of the main line of products
- 【音视频】ijkplayer错误码
- The general trend of data news releases the power of visual reporting ----- essays after reading
- [cocos creator] Click the button to switch the interface
- 图像处理8-CNN图像分类
- P1896 [SCOI2005] 互不侵犯(状压dp)
- 梯度下降法求解BP神经网络的简单Demo
猜你喜欢
P1596 [USACO10OCT]Lake Counting S
Detailed explanation of all transfer function (activation function) formulas of MATLAB neural network
the installer has encountered an unexpected error installing this package
数据库应用技术课程设计之商城管理系统
Three characteristics
Unity4.3.1 engine source code compilation process
Minimap plug-in
CLion-Toolchains are not configured Configure Disable profile问题解决
Image processing 8-cnn image classification
A tunnel to all ports of the server
随机推荐
MaxCompute字符串分割函数-SPLIT_PART
Unity performance optimization
Easy touch plug-in
Abstract classes and interfaces
796 · 开锁
Display terrain database on osgearth ball
Haproxy+kept build 01
Base64和Base64URL
What is BFC?
Some understandings of 3dfiles
String class
Compilation error: "not in executable format: file format not recognized"“
Unity2019_ Lighting system
[USACO12MAR]Cows in a Skyscraper G(状态压缩dp)
Transplantation of tslib Library
oracle中的 (+)是什么意思
P1896 [SCOI2005] 互不侵犯(状压dp)
LinkList
Basic operation and process control 2
Youyou1 of xlua knapsack system