Overview
By chance, I learned from the CSDN advertising push that Huawei Cloud recently launched a cost-effective cloud server instance, so I gave it a try. This article records the trial process and is suitable for students who have no experience in using cloud servers.
try out
Search for "Yunyao Cloud Server" and it is not difficult to find the purchase entrance:
You can see that Yunyao Cloud Server L provides several image templates, such as [One-stop DevOps Platform GitLab], which eliminates the repetitive work of building GitLab yourself. Still very humane.
Here we choose the most basic model [Linux Visual Pagoda Panel], and then come to the server specification selection module,
2C2G3M + 40G disk space, only 55 yuan a month is still very cheap.
It also provides security, backup and other component functions:
because it is for personal use and not a production environment, it does not require host security or data backup functions. Then enter the ordering interface. After the purchase is successful, you can see the following information in Resources—My Resources:
ok. So how to log in to the remote server through SSH connection? First you need to know your username and password. Find the [Reset Password] entrance in the upper right corner of the page:
Enter the password setting page (because no password has been set before, of course there is no reset password), but entering this page again is to reset the password. After successfully setting the password, you need to restart the server.
Then you can use an SSH client to connect. I am using the SSH artifact Termius tutorial.
It comes with Python 3.10.6 pre-installed:
the command prompt is also very friendly:
root@hcss-ecs-1a2d:~# mvn
Command 'mvn' not found, but can be installed with:
apt install maven
The pip3 version is 22.0.2:
root@hcss-ecs-1a2d:~# pip3 --version
pip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10)
Actual combat
As a small experimental project, install Superset. Superset is an open source BI visualization system.
Execute the command pip3 install apache-superset
, and the pip download speed is very fast. There is no need to configure the pip source yourself, such as Douban source https://pypi.douban.com/simple/
and Tsinghua source https://pypi.tuna.tsinghua.edu.cn/simple
.
Wait for the installation to complete. Execute command: superset db upgrade
, error message:
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.
Execute the command: export FLASK_APP=superset
, execute the command again: superset db upgrade
, error message:
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
Executing the command openssl rand -base64 42
generates a long string of random strings that serve as the password, ie SECRET_KEY
. Then execute: export SUPERSET_SECRET_KEY="刚才生成的随机字符串"
.
Execute the command again: superset db upgrade
, you can see a large string of information printed on the console, indicating that success is in sight.
Execute the command: superset fab create-admin
, if you need to input interactively, just press Enter; finally enter the password and confirm the password:
Username [admin]:
User first name [admin]:
User last name [user]:
Email [[email protected]]:
Password:
Repeat for confirmation:
Recognized Database Authentications.
Admin User admin created.
Execute the command: superset load_examples
, this place will wait for a long time, or directly report an error:
raise IncompleteRead(data, amt-len(data))
http.client.IncompleteRead: IncompleteRead(387727 bytes read, 14364712 more expected)
or
raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 110] Connection timed out>
Analysis:
Because the example data is stored in GitHub, GitHub is very slow when opened under mainland network conditions, and the example data itself is very large. Then we can download it in advance, download the address , and open a tab in the Chrome browser: chrome://downloads/
you can check the download progress. After the download was completed, I learned that it was a 28.6 MB ZIP compressed package.
Decompress the zip package, use the SFTP function of Termius, upload it to the server, and place it in the root directory:
root@hcss-ecs-1a2d:~# ls
examples-data-master HSSInstall install.sh snap stackhub
Check online whether the domain name or IP port is open . The detection results are:
Turn off the firewall:
root@hcss-ecs-1a2d:~# sudo ufw disable
Firewall stopped and disabled on system startup
https://blog.csdn.net/lsmsrc/article/details/121861176
Excuting an order:superset init
Start Superset:superset run -p 8088 --with-threads --reload --debugger
other
entrust
Create a delegate,
reference
a-default-secret-key-was-detected-please-use-superset-config-py-to-override-it