当前位置:网站首页>Open the jupyter notebook/lab and FAQ & settings on the remote server with the local browser
Open the jupyter notebook/lab and FAQ & settings on the remote server with the local browser
2022-06-30 21:37:00 【A big cat who wants to lie flat every day】
List of articles
We often work on remote servers , And want to open... On the remote server in the local browser Jupyter Notebook. This can be achieved in the following way .
Open... On the remote server in the local browser Jupyter Notebook
- see jupyter Configuration file for
First check whether there is a configuration file/home/xxx/.jupyter/jupyter_notebook_config.py, among xxx It's your user name .
If not , The following command generates :$ jupyter notebook --generate-config Writing default config to: /home/xxx/.jupyter/jupyter_notebook_config.py - modify jupyter The configuration file
Open profile , You will find that all the settings are comment Dropped , You can find the following settings to modify and remove comment, Or write the following settings directly into the configuration file .c.NotebookApp.ip = '*' # configure the notebook server to listen on all network interfaces # Or you could write it as c.NotebookApp.ip = '0.0.0.0', It has the same effect c.NotebookApp.open_browser = False # disable the automatic launching of the web browser - function jupyter And in the local browser through ip:8888 open
After the above settings are completed , Start on the remote server jupyter, The following page will appear :
It is now possible to use in your local browser ip:8888 Open... On the remote server notebook 了 . among 8888 yes notebook Default usage port ,IP It's a remote server IP Address . There is no remote server Jupyter Set the password , From a safety standpoint , I suggest you set up a .
Explain the above configuration , This method is through notebook server set public The way to achieve .notebook server The default is to listen only localhost/127.0.0.1 This interface's (By default the notebook server only listens on the localhost/127.0.0.1 network interface). If you want to connect remotely notebook Words , We need to make notebook Can listen to all network interfaces , And don't open the browser .c.NotebookApp.ip = '*' This configuration makes notebook server Can listen to all network interfaces , and c.NotebookApp.open_browser = False This configuration turns off the browser auto open setting .
Other settings
Common settings for quick query
The following are common settings in the configuration file , It can also be started notebook Parameter settings are used
| Common settings | meaning |
|---|---|
| c.NotebookApp.ip = ‘*’ | For all ip All open access |
| c.NotebookApp.open_browser = False | The browser auto open setting is turned off |
| c.NotebookApp.port = number | The default port is set to number |
Set up jupyter password
- Open one python Interpreter , Execute it inside
from notebook.auth import passwd; passwd() - Interactively fill in your desired password , Repeat twice , You can get the password sha code , Copy this code

- open jupyter Configuration file for
- View configuration items :c.NotebookApp.password, Put the password just copied sha code , Fill in this configuration
- restart jupyter notebook
Set up jupyter port
jupyter The default port is 8888, If this port is occupied or there are other requirements for setting ports , You can modify the configuration file
c.NotebookApp.port = number
Or start jupyter Through parameter setting
jupyter notebook --port number
Switch in the browser jupyter notebook and jupyter lab
ip:8888/tree open jupyter notebook
ip:8888/lab open jupyter lab
common problem
Remote access is not available , But start jupyter Your server can
( The following problems and solutions were summarized by a colleague , Feel very useful and often refer to , So I moved here )
The following troubleshooting points are performed from top to bottom
| Check the point | command | Where orders are executed | Normal phenomena | Abnormal phenomenon | How to solve |
|---|---|---|---|---|---|
| Whether the network is unobstructed | ping The goal is ip | On the remote machine | Keep popping up new progress | Show only one line , Stuck | testing ip Whether it is filled in incorrectly ; Find relevant people to solve |
| Whether the port is unobstructed | nmap -p port The goal is ip | On the remote machine | ![]() | ![]() | If it is closed: Indicates that the remote service is not started , Or you cannot access it due to service reasons . Please check whether there is restricted access in the service configuration ip The option to . If it is filterd: Representatives are filtered by the firewall , Please check the firewall restrictions |
| jupyter Whether the configuration restricts access ip | open jupyter The configuration file , see c.NotebookApp.ip To configure | c.NotebookApp.ip = ‘*’ perhaps ’0.0.0.0’ For all ip All open access | #c.NotebookApp.ip ='localhost’ or c.NotebookApp.ip = ‘localhost’ This is the default , Delegates can only start notebook Access to | Set this configuration to the correct format | |
| Whether the firewall has restrictions | be limited to centos7 Solutions for sudo firewall-cmd --list-ports | start-up notebook On the machine | Firewall OFF ![]() Or the listed port contains the port you started notebook The port of ![]() | This port is not included | Open ports sudo firewall-cmd --zone=public --add-port=8888/tcp --permanent sudo firewall-cmd --reload |
边栏推荐
- What does grade evaluation mean? What is included in the workflow?
- Document Layout Analysis: A Comprehensive Survey 2019论文学习总结
- Three techniques for reducing debugging time of embedded software
- Electronic scheme development - Intelligent rope skipping scheme
- Iclr'22 spotlight | how to measure the amount of information in neural network weights?
- SQL server extracts pure numbers from strings
- asp.net core JWT传递
- Ten security measures against unauthorized access attacks
- Auto-created primary key used when not defining a primary key
- Upgrade Kube with unknown flag: --network plugin
猜你喜欢
测试媒资缓存问题

Icml2022 | utility theory of sequential decision making

pytorch geometric torch-scatter和torch-sparse安装报错问题解决
一文读懂什么是MySQL索引下推(ICP)

Prediction and regression of stacking integrated model

qsort函数和模拟实现qsort函数

ArcGIS construction and release of simple road network data service and rest call test

asp.net core JWT传递

Arcmap|assign values to different categories of IDS with the field calculator

《ClickHouse原理解析与应用实践》读书笔记(2)
随机推荐
1-20 预检请求
. NETCORE redis geo type
Markdown notes concise tutorial
1-12 初步认识Express
Random talk about Clickhouse join
Jupyterbook clear console output
Auto-created primary key used when not defining a primary key
Use the log server to output the topn of various Apache logs
Deployment and use of Nacos
The 16th Heilongjiang Provincial Collegiate Programming Contest
Document Layout Analysis: A Comprehensive Survey 2019论文学习总结
1-19 利用CORS解决接口跨域问题
ArcGIS construction and release of simple road network data service and rest call test
【回溯】全排列 leetcode46
Fletter nested hell? No, constraintlayout to save!
1-13 express监听GET和POST请求&处理请求
jupyterbook 清空控制台输出
1-15 nodemon
介绍一款|用于多组学整合和网络可视化分析的在线平台
ca i啊几次哦啊句iu家哦11111



