Files
nexus/wiki/sources/install-apache-superset-in-docker.md

83 lines
3.6 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: "Install Apache Superset in Docker"
type: source
tags: [apache, bi, docker, mysql, superset]
date: 2026-04-14
---
## Source File
- [[raw/Home Office/Install Apache Superset in Docker.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 run -d -p 8777:8088 -e "SUPERSET_SECRET_KEY=*** --name superset apache/superset:GHA-19524015706"` — 容器启动命令,将宿主机的 8777 端口映射到容器的 8088 端口Superset 默认 Web UI 端口)
>
> `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
- 与 [[用docker安装apache-superset]] 可能的冲突:
- 冲突点两篇文档可能描述不同的安装方式Docker Run vs Docker Compose
- 当前观点:本篇使用 `docker run` 单容器模式,适合快速尝鲜
- 对方观点Docker Compose 模式便于多容器协同Redis + PostgreSQL + Superset更适合生产环境
## 安装步骤速查
```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`