在服务器上启动jupter notebook,复制网站和token,发现网页打不开。原因是防火墙没有开放该端口(例如8888)
└──╼ jupyter notebook --ip 0.0.0.0
[I 09:13:36.965 NotebookApp] Writing notebook server cookie secret to /run/user/1000/jupyter/notebook_cookie_secret
[I 09:13:37.081 NotebookApp] Serving notebooks from local directory: /data/05.seqdata/08.APUS5/SEQ_201807
[I 09:13:37.081 NotebookApp] 0 active kernels
[I 09:13:37.081 NotebookApp] The Jupyter Notebook is running at: http://0.0.0.0:8888/?token=82377c20c3deba79e32d1831209ede7afac0e103e998f18c
[I 09:13:37.081 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[W 09:13:37.081 NotebookApp] No web browser found: could not locate runnable browser.
[C 09:13:37.082 NotebookApp]
Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://0.0.0.0:8888/?token=82377c20c3deba79e32d1831209ede7afac0e103e998f18c
退出jupyter notebook , 防火墙开放目标端口, 然后再启动jupyter notebook
sudo su
systemctl status firewalld #查看firewalld状态
systemctl start firewalld #若没开启,则开启防火墙,没有任何提示即开启成功。
firewall-cmd --zone=public --add-port=8888/tcp --permanent #开放端口8888
firewall-cmd --reload #重置
firewall-cmd --list-ports #查看目前开放端口列表
exit