[root@bigdata005 ~]#
[root@bigdata005 ~]# yum install -y libffi-devel gcc-c++
[root@bigdata005 ~]#
这里我们安装两个python
[root@bigdata005 python3]#
[root@bigdata005 python3]# pip3 install --upgrade pip
[root@bigdata005 python3]#
[root@bigdata005 python3]# pip3 install virtualenv
[root@bigdata005 python3]#
[root@bigdata005 python3]#
[root@bigdata005 python3]# /opt/python3/python-3.9.6/bin/virtualenv superset --python=/opt/python3/python-3.7.11/bin/python3.7
[root@bigdata005 python3]#
会在当前目录生成虚拟的python3.7环境目录superset
[root@bigdata005 python3]#
[root@bigdata005 python3]# . /opt/python3/superset/bin/activate
(superset) [root@bigdata005 python3]#
(superset) [root@bigdata005 python3]#
(superset) [root@bigdata005 python3]# pip3 install --upgrade pip
(superset) [root@bigdata005 python3]#
(superset) [root@bigdata005 python3]# pip3 install pymysql
(superset) [root@bigdata005 python3]#
[root@bigdata005 ~]#
[root@bigdata005 ~]# mysql -u root -pRoot_123
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 922
Server version: 8.0.25 MySQL Community Server - GPL
Copyright (c) 2000, 2021, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
mysql> create database superset;
Query OK, 1 row affected (0.01 sec)
mysql>
(superset) [root@bigdata005 python3]#
(superset) [root@bigdata005 python3]# pip3 install apache-superset -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
(superset) [root@bigdata005 python3]#
export PYTHONPATH=/opt/python3/superset
(superset) [root@bigdata005 superset]# pwd
/opt/python3/superset
(superset) [root@bigdata005 superset]#
(superset) [root@bigdata005 superset]# touch superset_config.py
(superset) [root@bigdata005 superset]#
(superset) [root@bigdata005 superset]# vi superset_config.py
(superset) [root@bigdata005 superset]#
(superset) [root@bigdata005 superset]# cat superset_config.py
# Superset specific config
ROW_LIMIT = 5000
SUPERSET_WEBSERVER_PORT = 8088
# Flask App Builder configuration
# Your App secret key
SECRET_KEY = '\2\1thisismyscretkey\1\2\e\y\y\h'
# The SQLAlchemy connection string to your database backend
# This connection defines the path to the database that stores your
# superset metadata (slices, connections, tables, dashboards, ...).
# Note that the connection information to connect to the datasources
# you want to explore are managed directly in the web UI
SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:Root_123@bigdata005:3306/superset?charset=utf8'
(superset) [root@bigdata005 superset]#
修改/opt/python3/superset/lib/python3.7/site-packages/superset/config.py文件, 修改内容如下:
BABEL_DEFAULT_LOCALE = "zh"
(superset) [root@bigdata005 python3]#
(superset) [root@bigdata005 python3]# superset db upgrade
(superset) [root@bigdata005 python3]#
(superset) [root@bigdata005 python3]#
(superset) [root@bigdata005 python3]# export FLASK_APP=superset
(superset) [root@bigdata005 python3]#
(superset) [root@bigdata005 python3]#
(superset) [root@bigdata005 python3]# superset fab create-admin
/opt/python3/superset/lib/python3.7/site-packages/pandas/compat/__init__.py:109: UserWarning: Could not import the lzma module. Your installed Python is incomplete. Attempting to use lzma compression will result in a RuntimeError.
warnings.warn(msg)
logging was configured successfully
2021-08-20 10:55:54,786:INFO:superset.utils.logging_configurator:logging was configured successfully
2021-08-20 10:55:54,793:INFO:root:Configured event logger of type
/opt/python3/superset/lib/python3.7/site-packages/flask_caching/__init__.py:202: UserWarning: Flask-Caching: CACHE_TYPE is set to null, caching is effectively disabled.
"Flask-Caching: CACHE_TYPE is set to null, "
No PIL installation found
2021-08-20 10:55:55,054:INFO:superset.utils.screenshots:No PIL installation found
Username [admin]: admin
User first name [admin]: admin
User last name [user]: admin
Email [[email protected]]: [email protected]
Password:
Repeat for confirmation:
Recognized Database Authentications.
Admin User admin created.
(superset) [root@bigdata005 python3]#
[root@bigdata005 download2]#
[root@bigdata005 download2]# pwd
/opt/tomcat/apache-tomcat-10.0.10/download2
[root@bigdata005 download2]#
[root@bigdata005 download2]# cd superset/
[root@bigdata005 superset]#
[root@bigdata005 superset]# ls
examples-data-master examples-data-master.zip
[root@bigdata005 superset]#
[root@bigdata005 superset]# cd examples-data-master
[root@bigdata005 examples-data-master]#
[root@bigdata005 examples-data-master]# ll
总用量 25240
-rw-r--r--. 1 root root 9836 8月 11 09:42 airports.csv.gz
-rw-r--r--. 1 root root 1267 8月 11 09:42 bart-lines.json.gz
-rw-r--r--. 1 root root 6686 8月 11 09:42 birth_france_data_for_country_map.csv
-rw-r--r--. 1 root root 735076 8月 11 09:42 birth_names2.json.gz
-rw-r--r--. 1 root root 734913 8月 11 09:42 birth_names.json.gz
-rw-r--r--. 1 root root 14752439 8月 11 09:42 countries.json.gz
drwxr-xr-x. 3 root root 22 8月 11 09:42 datasets
-rw-r--r--. 1 root root 985 8月 11 09:42 energy.json.gz
-rw-r--r--. 1 root root 1897423 8月 11 09:42 flight_data.csv.gz
-rw-r--r--. 1 root root 38387 8月 11 09:42 multiformat_time_series.json.gz
-rw-r--r--. 1 root root 84 8月 11 09:42 NOTICE
-rw-r--r--. 1 root root 4427142 8月 11 09:42 paris_iris.json.gz
-rw-r--r--. 1 root root 264250 8月 11 09:42 random_time_series.json.gz
-rw-r--r--. 1 root root 125 8月 11 09:42 README.md
-rw-r--r--. 1 root root 2103726 8月 11 09:42 san_francisco.csv.gz
-rw-r--r--. 1 root root 47217 8月 11 09:42 sf_population.json.gz
-rw-r--r--. 1 root root 778847 8月 11 09:42 tutorial_flights.csv
-rw-r--r--. 1 root root 5030 8月 11 09:42 unicode_utf8_unixnl_test.csv
[root@bigdata005 examples-data-master]#
BASE_URL = "http://bigdata005:8090/download2/superset/examples-data-master/"
superset load_examples
解决superset load_examples
(superset) [root@bigdata005 python3]#
(superset) [root@bigdata005 python3]# superset init
(superset) [root@bigdata005 python3]#
(superset) [root@bigdata005 python3]#
(superset) [root@bigdata005 python3]# nohup superset run -h 0.0.0.0 -p 8088 --with-threads --reload >> /opt/python3/superset/superset.log 2>&1 &
[1] 17930
(superset) [root@bigdata005 python3]#