superset安装完整过程
1.安装superset所需python依赖包
wtforms_json、flask_compress、celery、flask_migrate、flask_talisman、flask_caching、sqlparse、bleach、markdown、numpy、pandas、parsedatetime、pathlib2、simplejson,humanize,python-geohash,polyline,geopy,cryptography,backoff,msgpack,pyarrow,contextlib2,croniter,retry,selenium,isodate
命令参照以下格式
1 | pip install wtforms_json |
2.安装(更新)setuptools和pip(为加速使用了国内镜像,可用可不用)
1 | pip install --upgrade setuptools pip -i https://repo.huaweicloud.com/repository/pypi/simple |
3.安装Supetset
1 | pip install apache-superset |
出现此类问题一般是Python版本问题,重新构造一个低版本一点的虚拟环境就行
4.初始化Supetset数据库
1 | superset db upgrade |
出现此类问题,进入到虚拟环境superset的bin目录下,新建文件vim superset_config.py ,添加内容以下
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | #Superset specific config # SS 相关的配置 # 行数限制 5000 行 ROW_LIMIT = 5000 # 网站服务器端口 8088 SUPERSET_WEBSERVER_PORT = 8088 # Flask App Builder configuration # Your App secret key will be used for securely signing the session cookie # and encrypting sensitive information on the database # Make sure you are changing this key for your deployment with a strong key . # You can generate a strong key using `openssl rand -base64 42` # Flask 应用构建器配置 # 应用密钥用来保护会话 cookie 的安全签名 # 并且用来加密数据库中的敏感信息 # 请确保在你的部署环境选择一个强密钥 # 可以使用命令 openssl rand -base64 42 来生成一个强密钥 SECRET_KEY = 'LqLpdU4LfBymvLBCxnM5vcdmBjqE5eBLu7fjMQHF9BWbi8QBzD4SFXmc' # 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 数据库连接信息 # 这个连接信息定义了 SS 元数据库的路径(切片、连接、表、数据面板等等) # 注意:需要探索的数据源连接及数据库连接直接通过网页界面进行管理 #SQLALCHEMY_DATABASE_URI = 'sqlite:path/to/superset.db' # Flask-WTF flag for CSRF # 跨域请求攻击标识 WTF_CSRF_ENABLED = True # Add endpoints that need to be exempt from CSRF protection # CSRF 白名单 WTF_CSRF_EXEMPT_LIST = [] # A CSRF token that expires in 1 year # CSFR 令牌过期时间 1 年 WTF_CSRF_TIME_LIMIT = 60 * 60 * 24 * 365 # Set this API key to enable Mapbox visualizations # 接口密钥用来启用 Mapbox 可视化 MAPBOX_API_KEY = '' |
1 | SECRET_KEY通过下面命令生成一个强秘钥,替换上述相应处 |
1 | openssl rand -base64 42 |
5.superset初始化
1 | superset init |
6.创建管理员,只需要填写用户名和密码,其他回车就行
1 2 | export FLASK_APP=superset superset fab create -admin |
7.安装gunicorn
1 | pip install gunicorn |
8.启动superset,这里的localhost可以替换为superset安装机器地址
1 | gunicorn --workers 5 --timeout 120 --bind localhost:8787 "superset.app:create_app()" --daemon |
9.停止superset,并退出该环境
1 2 | ps -ef | awk '/superset/ && !/awk/{print $2}' | xargs kill -9 conda deactivate |
分类:
大数据学习
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?