标签:zip 启动 container host lin dir engine load super
Superset 是一款由 Airbnb 开源的“现代化的企业级 BI(商业智能) Web 应用程序”,其通过创建和分享 dashboard,为数据分析提供了轻量级的数据查询和可视化方案。
最方便的搭建方法就是使用docker运行:
系统环境准备:
apt-get upgrade && apt-get update
安装docker
> apt install docker.io > systemctl start docker > systemctl enable docker
获取镜像
> docker search superset > docker pull amancevice/superset
> docker images REPOSITORY TAG IMAGE ID CREATED SIZE amancevice/superset latest 26506f00f388 5 weeks ago 1.4GB
# 创建挂载目录 > mkdir /data/superset -p # 启动 > docker run -d -p 8088:8088 --name superset -v /data/superset:/home/superset amancevice/superset:latest 18c22f0fc458b6b727f6b2705b69c5226c8471714f97740fe462daf3444be666 # 查看启动的容器 > docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 18c22f0fc458 amancevice/superset:latest "gunicorn superset:a…" 4 seconds ago Up 3 seconds (health: starting) 0.0.0.0:8088->8088/tcp jovial_nash
# 创建用户名和密码 > docker exec -it -u root 18c22f0fc458 fabmanager create-admin --app superset # 初始化数据库 > docker exec -it 18c22f0fc458 superset db upgrade # 导入示例数据 > docker exec -it 18c22f0fc458 superset load_examples # 创建默认角色和权限 > docker exec -it 18c22f0fc458 superset init # 启动服务 > docker exec -it 18c22f0fc458 superset runserver
数据库依赖软件安装文档:
http://superset.apache.org/installation.html#database-dependencies
这里是在docker容器中安装依赖,Oracle客户端下载列表:
https://www.oracle.com/technetwork/database/database-technologies/instant-client/downloads/index.html
# 把下载的Oracle客户端包放在挂载目录: > cp instantclient-basic-linux.x64-11.2.0.4.0.zip /data/superset # 进入容器: > docker exec -it -u root 83a1cb4cf984 bash # 在容器内部安装Oracle客户端和cx_Oracle依赖包 root@83a1cb4cf984> apt-get -y upgrade && apt-get -y update root@83a1cb4cf984> apt-get install -y libaio1 root@83a1cb4cf984> pip3 install cx_Oracle root@83a1cb4cf984> mkdir /opt/oracle root@83a1cb4cf984> unzip instantclient-basic-linux.x64-11.2.0.4.0.zip -d /opt/oracle/ root@83a1cb4cf984> cd /opt/oracle/instantclient_11_2/ root@83a1cb4cf984> ln -s libclntsh.so.11.1 libclntsh.so root@83a1cb4cf984> ln -s libocci.so.11.1 libocci.so root@83a1cb4cf984> echo /opt/oracle/instantclient_11_2 > /etc/ld.so.conf.d/oracle-instantclient.conf root@83a1cb4cf984> ldconfig # 创建 tnsnames.ora 文件,配置Oracle连接信息: root@83a1cb4cf984> mkdir -p /opt/oracle/instantclient_11_2/network/admin root@83a1cb4cf984> echo ‘DB-NAME = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.66 )(PORT = 1521)) ) (CONNECT_DATA=(SERVICE_NAME=orcl)))‘ > /opt/oracle/instantclient_11_2/network/admin/tnsnames.ora root@83a1cb4cf984> exit
以上步骤其实可以用dockerfile批量完成。
在浏览器打来 http://ip:8088,访问superset配置:
数据库连接详细配置见:
https://docs.sqlalchemy.org/en/13/core/engines.html#database-urls
标签:zip 启动 container host lin dir engine load super
原文地址:https://www.cnblogs.com/adolfmc/p/12961156.html