superset安装部署

superset安装部署 安装Python3环境准备的包

[root@JD /]# yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel[root@JD src]# pwd /usr/local/src [root@JD src]# ll total 22396 -rw-r--r-- 1 root root 22930752 Dec 29 14:52 Python-3.6.6.tgz

安装Python3环境
#解压缩 [root@JD src]# tar-xf Python-3.6.6.tgz #配置 [root@JD Python-3.6.6]# ./configure checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-linux-gnu checking for python3.6... no checking for python3... no checking for python... python checking for --enable-universalsdk... no checking for --with-universal-archs... no checking MACHDEP... linux checking for --without-gcc... no checking for --with-icc... no checking for gcc... no checking for cc... no checking for cl.exe... no configure: error: in `/usr/local/src/Python-3.6.6': configure: error: no acceptable C compiler found in $PATH See `config.log' for more details安装gcc 解决报错 yum -y install gcc重新执行配置 [root@JD Python-3.6.6]# ./configure#安装 [root@JD Python-3.6.6]# make && make install

安装EPEL源并安装superset必备的包
#安装epel源 [root@JD Python-3.6.6]# yum -y install epel-release#安装MySQL开发包,属于pymysqlclient依赖 [root@JD Python-3.6.6]# yum -y install mysql-devel#安装依赖包 [root@JD Python-3.6.6]# yum -y install gcc gcc-c++ libffi-devel python-devel python-wheel openssl-devel libsasl2-devel openldap-devel

安装python3的virtualenv并建?superset的env
#安装virtualenv [root@JD Python-3.6.6]# pip3 install virtualenv -i http://pypi.douban.com/simple --trusted-host pypi.douban.com#建立superset的venv [root@JD Python-3.6.6]# cd ../ [root@JD src]# pwd /usr/local/src [root@JD src]# python3 -m venv superset-py3#激活superset的venv [root@JD src]# source superset-py3/bin/activate (superset-py3) [root@JD src]#

在env中安装superset
#升级pip (superset-py3) [root@JD src]# pip3 install --upgrade pip -i http://pypi.douban.com/simple --trusted-host pypi.douban.com#升级setuptools (superset-py3) [root@JD src]# pip3 install --upgrade setuptools -i http://pypi.douban.com/simple --trusted-host pypi.douban.com#安装superset (superset-py3) [root@JD src]# pip3 install superset -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

安装superset数据库包
#安装mysql连接包 (superset-py3) [root@JD src]# pip3 install mysqlclient -i http://pypi.douban.com/simple --trusted-host pypi.douban.com#安装mssql连接包 (superset-py3) [root@JD src]# pip3 install "pymssql<3.0" -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

配置superset
(superset-py3) [root@JD src]# vi superset-py3/lib/python3.6/site-packages/superset/config.py修改superset配置?件,将默认的sqlite3数据库改为MySQL找到: SQLALCHEMY_DATABASE_URI = 'mysql://root:mysqladmin@JD/superset?charset=utf8'

mysql创建superset数据库
create database `superset`;

初始化
#建立管理员账号 jepson,密码123456 (superset-py3) [root@JD src]# fabmanager create-admin --app superset fabmanager is going to be deprecated in 2.2.X, you can use the same commands on the improved 'flask fab ' Username [admin]: admin User first name [admin]: admin User last name [user]: admin Email [admin@fab.org]: 790461730@qq.com Password: Repeat for confirmation: 2019-12-30 01:53:38,115:INFO:root:Configured event logger of type Recognized Database Authentications. Admin User admin created.(superset-py3) [root@JD src]# superset db upgrade#初始化superset数据库 (superset-py3) [root@JD src]# superset initmysql执行 alter table superset.table_columns modify type varchar(255);

后台启动
nohup superset run -h JD -p 8889 &

Web
http://JD:8889 admin/admin

    推荐阅读