1.安装
pip install apache-superset -i https://pypi.douban.com/simple/
2.初始化数据库
superset db upgrade
3.创建管理员
export FLASK_APP=superset
flask fab create-admin
4. 初始化
superset init
5.安装gunicorn
pip install gunicorn -i https://pypi.douban.com/simple/
6.启动superset
gunicorn --workers 5 --timeout 120 --bind xxx.xxx.xxx.xxx:8787 superset:app
如果不写APP_MODULE (superset:app) 会报错 (重点)
usage: gunicorn [OPTIONS] [APP_MODULE]
gunicorn: error: No application module specified.
7.8787 端口可能被占用,启动异常 (重点)
(base) [root@BigData116 miniconda]# gunicorn -w 5 -t 120 --bind 192.168.127.128:8787 superset:app
[2020-07-07 22:49:52 +0800] [18991] [INFO] Starting gunicorn 20.0.4
[2020-07-07 22:49:52 +0800] [18991] [ERROR] Connection in use: ('192.168.127.128', 8787)
[2020-07-07 22:49:52 +0800] [18991] [ERROR] Retrying in 1 second.
[2020-07-07 22:49:53 +0800] [18991] [ERROR] Connection in use: ('192.168.127.128', 8787)
[2020-07-07 22:49:53 +0800] [18991] [ERROR] Retrying in 1 second.
[2020-07-07 22:49:54 +0800] [18991] [ERROR] Connection in use: ('192.168.127.128', 8787)
[2020-07-07 22:49:54 +0800] [18991] [ERROR] Retrying in 1 second.
[2020-07-07 22:49:55 +0800] [18991] [ERROR] Connection in use: ('192.168.127.128', 8787)
[2020-07-07 22:49:55 +0800] [18991] [ERROR] Retrying in 1 second.
[2020-07-07 22:49:56 +0800] [18991] [ERROR] Connection in use: ('192.168.127.128', 8787)
[2020-07-07 22:49:56 +0800] [18991] [ERROR] Retrying in 1 second.
[2020-07-07 22:49:57 +0800] [18991] [ERROR] Can't connect to ('192.168.127.128', 8787)
8.查看端口占用情况
netstat -tunlp
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1272/sshd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1274/cupsd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1434/master
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1/systemd
tcp 0 0 192.168.127.128:8787 0.0.0.0:* LISTEN 18655/python
kill -9 PID