从配置环境起,让咱们一起入坑AI吧~ Let’s Go~~~
查看当前系统内核版本
uname -a
[root@iZuf630bctfwzkfl2xfxa7Z doc]
Linux iZuf630bctfwzkfl2xfxa7Z 4.18.0-193.14.2.el8_2.x86_64
查看当前操作系统
cat /etc/centos-release
[root@iZuf630bctfwzkfl2xfxa7Z ~]
CentOS Linux release 8.4.2105
安装apt-get
[root@iZuf630bctfwzkfl2xfxa7Z ~]
CentOS Linux release 8.4.2105
[root@iZuf630bctfwzkfl2xfxa7Z ~]
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1256 100 1256 0 0 2914 0 --:--:-- --:--:-- --:--:-- 2920
[root@iZuf630bctfwzkfl2xfxa7Z ~]
Welcome to Alibaba Cloud Elastic Compute Service !
Activate the web console with: systemctl enable --now cockpit.socket
Last login: Sun Sep 5 20:34:16 2021 from 112.65.13.67
设置权限
[root@iZuf630bctfwzkfl2xfxa7Z ~]
安装Pip3
[root@iZuf630bctfwzkfl2xfxa7Z ~]
Repository epel is listed more than once in the configuration
Last metadata expiration check: 0:49:27 ago on Sun 05 Sep 2021 09:06:07 PM CST.
Package python3-pip-9.0.3-19.el8.noarch is already installed.
Dependencies resolved.
Nothing to do.
Complete!
安装jupyter
[root@iZuf630bctfwzkfl2xfxa7Z ~]
生成Jupyter配置文件
#root客户: jupyter notebook --generate-config --allow-root #非root客户 jupyter notebook --generate-config
[root@iZuf630bctfwzkfl2xfxa7Z ~]
Writing default config to: /root/.jupyter/jupyter_notebook_config.py
打开Ipython,生成密码
[root@iZuf630bctfwzkfl2xfxa7Z ~]
Python 3.6.8 (default, Mar 19 2021, 05:13:41)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.16.1 -- An enhanced Interactive Python. Type '?' for help.
In [2]: from notebook.auth import passwd
In [3]: passwd()
会让输入两次密码,输入完成后 复制生成的 秘钥,后面会用到,秘钥带上sha1
修改配置文件,root用户默认在root目录
[root@iZuf630bctfwzkfl2xfxa7Z ~]
c.NotebookApp.ip = 'xx.xxx.xx.xxx' 对外提供访问的ip,云服务外网ip
c.NotebookApp.port = 8123 对外提供访问的端口
c.NotebookApp.open_browser = False False启动不打开浏览器
c.NotebookApp.password = u'sha1:XXXXX' 上面生成的秘钥
c.NotebookApp.notebook_dir = u'/opt/jupyter_dir' 设置jupyter启动后默认根目录
启动jupyter
root用户,后台启动
[root@iZuf630bctfwzkfl2xfxa7Z ~]
[1] 2667437
[root@iZuf630bctfwzkfl2xfxa7Z ~]
非root
[root@iZuf630bctfwzkfl2xfxa7Z ~]
本地访问
https://blog.csdn.net/z136435458/article/details/92853982
|