华为云云耀云服务器L试用及实战安装Superset(适合没有云服务器使用经验

概述

偶然间在CSDN广告推送里得知华为云最近推出一款高性价比的云服务器实例,故而试用一下。本文记录试用过程,适合没有云服务器使用经验的同学。

试用

搜索"云耀云服务器",不难找到购买入口:
在这里插入图片描述
可以看到云耀云服务器L提供好几个镜像模板,比如其中的【一站式DevOps平台GitLab】,免去自己搭建GitLab的重复性工作,还是非常人性化的。

这里我们选择最基础款【Linux可视化宝塔面板】,然后来到服务器规格选择模块,
在这里插入图片描述
2C2G3M + 40G磁盘空间,一个月才55元还是非常便宜的。

并提供安全、备份等组件功能:在这里插入图片描述
因为是个人使用,并不是生产环境,并不需要主机安全,也不需要数据备份功能。随后进入下单界面。购买成功后,在资源—我的资源里可以看到如下信息:
在这里插入图片描述
ok。那怎么通过SSH连接登录到远程服务器呢?首先得知道用户名和密码。页面右上角找到【重置密码】入口:
在这里插入图片描述
进入密码设置页面(因为之前没有设置过密码,所以当然不存在重置密码),不过再次进入此页面就是重置密码。设置密码成功后,需要重启服务器。

然后可以使用SSH客户端连接,我使用的是SSH神器Termius使用教程

在这里插入图片描述
已经预安装自带Python 3.10.6:
在这里插入图片描述
命令提示也是非常友好的:

root@hcss-ecs-1a2d:~# mvn
Command 'mvn' not found, but can be installed with:
apt install maven

pip3版本为22.0.2:

root@hcss-ecs-1a2d:~# pip3 --version
pip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10)

实战

作为试验小项目,安装Superset。Superset是一个开源的BI可视化系统。

执行命令pip3 install apache-superset,pip下载速度非常快,无需自己配置pip源,如豆瓣源https://pypi.douban.com/simple/,清华源https://pypi.tuna.tsinghua.edu.cn/simple

等待安装完成。执行命令:superset db upgrade,报错提示:

Error: Could not locate a Flask application. Use the 'flask --app' option, 'FLASK_APP' environment variable, or a 'wsgi.py' or 'app.py' file in the current directory.

执行命令:export FLASK_APP=superset,再次执行命令:superset db upgrade,报错提示:

A Default SECRET_KEY was detected, please use superset_config.py to override it.
Use a strong complex alphanumeric string and use a tool to help you generate 
a sufficiently random sequence, ex: openssl rand -base64 42
Refusing to start due to insecure SECRET_KEY

执行命令openssl rand -base64 42生成一长串随机字符串,作为密码,即SECRET_KEY。然后执行:export SUPERSET_SECRET_KEY="刚才生成的随机字符串"

再次执行命令:superset db upgrade,可以看到控制台打印一大串信息,表明成功在望。

执行命令:superset fab create-admin,交互式需要输入的直接回车即可;最后输入密码,确认密码即可:

Username [admin]:       
User first name [admin]: 
User last name [user]: 
Email [[email protected]]: 
Password: 
Repeat for confirmation: 
Recognized Database Authentications.
Admin User admin created.

执行命令:superset load_examples,这个地方会等待很久,或直接报错:

raise IncompleteRead(data, amt-len(data))
http.client.IncompleteRead: IncompleteRead(387727 bytes read, 14364712 more expected)

或者

raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 110] Connection timed out>

分析:
因为example数据是存放在GitHub的,GitHub在大陆网络条件下打开时速度非常慢,example数据本身又非常大。那我们可以提前下载好,下载地址,Chrome浏览器打开标签页:chrome://downloads/可以查看下载进度。下载完成后,得知是一个有28.6 MB的ZIP压缩包。

zip包解压缩,使用Termius的SFTP功能,上传到服务器,放在根目录即可:

root@hcss-ecs-1a2d:~# ls
examples-data-master  HSSInstall  install.sh  snap  stackhub

在线检测域名或者ip的端口是否开放,检测结果:
在这里插入图片描述
在这里插入图片描述

关闭防火墙:

root@hcss-ecs-1a2d:~# sudo ufw disable
Firewall stopped and disabled on system startup

https://blog.csdn.net/lsmsrc/article/details/121861176

执行命令:superset init

启动 Superset:superset run -p 8088 --with-threads --reload --debugger

其他

委托

创建委托,

参考

a-default-secret-key-was-detected-please-use-superset-config-py-to-override-it

猜你喜欢

转载自blog.csdn.net/lonelymanontheway/article/details/120147944
今日推荐