Files
nexus/wiki/sources/用docker安装apache-superset.md
2026-04-27 16:26:34 +08:00

87 lines
3.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "用Docker安装Apache Superset"
type: source
tags: [apache, bi, docker, mysql, superset]
date: 2026-04-14
---
## Source File
- [[raw/Home Office/用Docker安装Apache Superset.md]]
## Summary用中文描述
- **核心主题**:通过 Docker 容器快速部署 Apache Superset BI 平台
- **问题域**:数据可视化与 BI 工具的本地化安装
- **方法/机制**:使用 Docker Hub 官方镜像 `apache/superset`,通过 docker exec 进入容器执行初始化命令
- **结论/价值**:提供一套标准化、可复现的 Superset 部署流程,适合开发测试环境快速搭建
## Key Claims用中文描述
- Docker 容器化部署可将 Superset 安装时间压缩至分钟级别
- 通过 `superset fab create-admin` 命令创建管理员账户是初始化第一步
- `superset db upgrade` 确保数据库 Schema 与当前版本同步
- `superset load_examples` 加载示例数据集,便于新用户快速上手
- `superset init` 完成权限和缓存的初始化
## Key Quotes
> `docker pull apache/superset:GHA-19524015706` — 拉取 GitHub Actions 构建版本的 Apache Superset 官方镜像
>
> `docker run -d -p 8777:8088 -e "SUPERSET_SECRET_KEY=*** --name superset apache/superset:GHA-19524015706` — 容器启动命令,将宿主机的 8777 端口映射到容器的 8088 端口Superset 默认 Web UI 端口),设置 SECRET_KEY 环境变量
>
> `docker exec -it superset superset fab create-admin --username admin --firstname Superset --lastname Admin --email admin@superset.com --password admin` — 管理员账户创建命令,用于首次登录系统
## Key Concepts
- [[Docker]]容器化平台Superset 的部署底座
- [[Docker-Image]]`apache/superset` 官方镜像
- [[容器初始化]]docker exec 进入运行中的容器执行初始化命令的流程
- [[BI平台]]Business Intelligence 平台Superset 属于开源 BI 工具
- [[数据可视化]]:将数据库数据转化为图表/仪表盘的技术
## Key Entities
- [[Apache Superset]]:开源 BI 和数据探索平台,由 Apache 软件基金会维护,支持 SQL 查询、可视化仪表盘和数据源连接
- [[MySQL]]:关系型数据库,在 Superset 中作为可选元数据存储(默认使用 SQLite
- [[Docker Hub]]:官方镜像仓库,`apache/superset` 的托管位置
## Connections
- [[Docker]] ← uses ← [[Apache Superset]]
- [[MySQL]] ← stores ← [[Apache Superset 元数据]]
- [[Docker]] ← extends ← [[Docker Compose]](生产环境推荐多容器协同)
- [[Apache Superset]] ← depends_on ← [[Flask]]Web 框架)
- [[Apache Superset]] ← depends_on ← [[SQLAlchemy]](数据库 ORM
## Contradictions
- 与 [[install-apache-superset-in-docker]] 无冲突:
- 两篇文档内容高度一致,均使用 `docker run` 单容器模式 + GHA 构建版本镜像,适合快速尝鲜
- 与 [[用docker安装portainer]] 同属 Home Office Docker 部署系列,可作为参考对照
## 安装步骤速查
```bash
# 1. 拉取镜像
docker pull apache/superset:GHA-19524015706
# 2. 运行容器
docker run -d -p 8777:8088 \
-e "SUPERSET_SECRET_KEY=***" \
--name superset \
apache/superset:GHA-19524015706
# 3. 创建管理员账户
docker exec -it superset superset fab create-admin \
--username admin \
--firstname Superset \
--lastname Admin \
--email admin@superset.com \
--password admin
# 4. 数据库迁移
docker exec -it superset superset db upgrade
# 5. 加载示例数据
docker exec -it superset superset load_examples
# 6. 初始化
docker exec -it superset superset init
```
访问地址:`http://localhost:8777`
默认凭据:`admin / admin`