# 依赖库安装
yum upgrade python-setuptools
yum install gcc gcc-c++ libffi-devel python-devel python-pip python-wheel openssl-devel libsasl2-devel openldap-devel
yum groupinstall "Development tools"
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
# 下载python3版本
cd /usr/local/src
wget https://www.python.org/ftp/python/3.6.9/Python-3.6.9.tgz
tar -zxvf Python-3.6.9.tgz
# 创建python编译安装的路径
mkdir /usr/local/python3
# 编译python
./configure --prefix=/usr/local/python3
make && make install
# 关联python依赖库
echo "/usr/local/python3/lib" >> /etc/ld.so.conf
ldconfig
# 指定软连接
ln -s /usr/local/python3/bin/python3.6 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
# 检查安装情况
python3 -V # 输出python3.6.9
python -V # 输出python2.7.5
pip3 -V # 输出(python3.6)
pip -V # 输出(python2.7)
#安装virtualenv
pip3 install virtualenv
#建立并进入虚拟环境
mkdir /usr/local/virenv
cd /usr/local/virenv
python3 -m virtualenv superset
source ./superset/bin/activate
#deactivate 退出虚拟环境
步骤五:安装Superset
# 新建superset_config.py
cd /usr/local/virenv/superset/bin
vi superset_config.py
##############superset_config.py#################
SUPERSET_WEBSERVER_PORT = 8888
SQLALCHEMY_DATABASE_URI = 'mysql://root:123456@******:3306/superset?charset=utf8'
BABEL_DEFAULT_LOCALE = 'zh'
CACHE_DEFAULT_TIMEOUT = 60 * 60
PUBLIC_ROLE_LIKE_GAMMA = True
LANGURAGES = {
'en':{'flag':'us','name':'English'},
'zh':{'flag':'cn','name':'Chinese'},
}
# APP_ICON = ''
######################End########################
在mysql
CREATE DATABASE `superset` CHARACTER SET utf8 COLLATE utf8_general_ci;
参考我得requirement.txt (最全)!
Package Version
---------------------- -----------
alembic 1.3.2
amqp 2.5.2
apache-superset 0.35.2
apispec 1.3.3
attrs 19.3.0
Babel 2.8.0
backoff 1.10.0
billiard 3.6.1.0
bleach 3.1.0
celery 4.4.0
certifi 2020.4.5.1
cffi 1.13.2
chardet 3.0.4
click 7.1.1
colorama 0.4.3
contextlib2 0.6.0.post1
croniter 0.3.31
cryptography 2.8
Cython 0.29.16
decorator 4.4.1
defusedxml 0.6.0
Flask 1.1.1
Flask-AppBuilder 2.3.2
Flask-Babel 1.0.0
Flask-Caching 1.8.0
Flask-Compress 1.4.0
Flask-JWT-Extended 3.24.1
Flask-Login 0.4.1
Flask-Migrate 2.5.2
Flask-OpenID 1.2.5
Flask-SQLAlchemy 2.4.1
flask-talisman 0.7.0
Flask-WTF 0.14.2
future 0.18.2
geographiclib 1.50
geopy 1.20.0
gevent 1.5.0
greenlet 0.4.15
gunicorn 20.0.4
humanize 0.5.1
idna 2.9
importlib-metadata 1.4.0
infi.clickhouse-orm 1.3.0
iso8601 0.1.12
isodate 0.6.0
itsdangerous 1.1.0
Jinja2 2.10.3
jsonschema 3.2.0
kombu 4.6.7
Mako 1.1.1
Markdown 3.1.1
MarkupSafe 1.1.1
marshmallow 2.19.5
marshmallow-enum 1.5.1
marshmallow-sqlalchemy 0.21.0
more-itertools 8.1.0
msgpack 0.6.2
mysqlclient 1.4.6
numpy 1.18.1
pandas 1.0.3
parsedatetime 2.5
pathlib2 2.3.5
pip 20.0.2
polyline 1.4.0
prison 0.1.3
py 1.8.1
pyarrow 0.16.0
pycparser 2.19
PyHive 0.6.2
PyJWT 1.7.1
pyrsistent 0.15.7
python-dateutil 2.8.1
python-dotenv 0.10.5
python-editor 1.0.4
python-geohash 0.8.5
python3-openid 3.1.0
pytz 2019.3
PyYAML 5.3
requests 2.23.0
retry 0.9.2
sasl 0.2.1
selenium 3.141.0
setuptools 46.1.3
simplejson 3.17.0
six 1.14.0
SQLAlchemy 1.3.16
sqlalchemy-clickhouse 0.1.5.post0
SQLAlchemy-Utils 0.36.1
sqlparse 0.3.0
thrift 0.13.0
thrift-sasl 0.4.2
urllib3 1.25.8
vine 1.3.0
webencodings 0.5.1
Werkzeug 0.16.0
wheel 0.34.2
WTForms 2.2.1
WTForms-JSON 0.3.3
zipp 2.0.0
pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirement.txt
安装mysqlclient 报错:mysql_config
wget http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm
2.这是在/etc/yum.repos.d/目录下会出现MySQL的相关repo
rpm -ivh mysql57-community-release-el7-8.noarch.rpm
[root@localhost tmp]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ls
CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo mysql-community.repo
CentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo mongodb-org-3.2.repo mysql-community-source.repo
3.现在有MySQL的源,可以安装mysql-devel了
[root@localhost yum.repos.d]# yum install mysql-devel
Loaded plugins: fastestmirror, langpacks
mysql-connectors-community | 2.5 kB 00:00:00
mysql-tools-community | 2.5 kB 00:00:00
mysql57-community | 2.5 kB 00:00:00
mysql57-community/x86_64/primary_db | 76 kB 00:00:00
Loading mirror speeds from cached hostfile
* base: mirrors.cqu.edu.cn
* extras: mirrors.163.com
* updates: mirrors.163.com
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-devel.x86_64 0:5.7.15-1.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
===========================================================================================================================================================================
Package Arch Version Repository Size
===========================================================================================================================================================================
Installing:
mysql-community-devel x86_64 5.7.15-1.el7 mysql57-community 3.6 M
Transaction Summary
===========================================================================================================================================================================
Install 1 Package
Total download size: 3.6 M
Installed size: 21 M
Is this ok [y/d/N]: y
Downloading packages:
mysql-community-devel-5.7.15-1.el7.x86_64.rpm | 3.6 MB 00:00:05
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
** Found 2 pre-existing rpmdb problem(s), 'yum check' output follows:
icedtea-web-1.6.1-4.el7.x86_64 has missing requires of java-1.8.0-openjdk
jline-1.0-8.el7.noarch has missing requires of java >= ('0', '1.5', None)
Installing : mysql-community-devel-5.7.15-1.el7.x86_64 1/1
Verifying : mysql-community-devel-5.7.15-1.el7.x86_64 1/1
Installed:
mysql-community-devel.x86_64 0:5.7.15-1.el7
Complete!
[root@localhost yum.repos.d]#
pip3 install superset
# 初始化用户
export FLASK_APP=superset
flask fab create-admin
# 刷新数据库
superset db upgrade
superset init
运行:
nohup gunicorn -w 5 -b 0.0.0.0:8888 superset:app &