当前位置:网站首页>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
边栏推荐
- Base64和Base64URL
- oracle中的 (+)是什么意思
- Clion toolchains are not configured configure disable profile problem solving
- Demonstration of plug-in use of ventuz basic series
- The general trend of data news releases the power of visual reporting ----- essays after reading
- Free use until 2015 -- viz artist multi touch plug-in package
- Conversion between string and int types in golang
- 【音视频】ijkplayer错误码
- Lua framwrok framework starts
- I want to do large screen data visualization application feature analysis
猜你喜欢
随机推荐
Haproxy+kept cluster setup 02
Demonstration of plug-in use of ventuz basic series
matlab神經網絡所有傳遞函數(激活函數)公式詳解
Multi traveling salesman problem -- overview of formula and solution process
P1896 [SCOI2005] 互不侵犯(状压dp)
tslib库的移植
idea取消引用顯示效果
Golang json格式和结构体相互转换
Use of ue5 QRcode plug-in
Display terrain database on osgearth ball
the installer has encountered an unexpected error installing this package
P2622 light off problem II (state compression search)
Golang string segmentation, substitution and interception
L'installateur a été installé avec une erreur inattendue
ArrayList
Youyou1 of xlua knapsack system
[global product discovery 2] the first pure cloud augmented reality (AR) platform - Israel
Shader foundation 01
Oracle insert single quotation mark
Unity2019_ Lighting system