使用minio + iceberg-rest + amoro+ + trino搭建iceberg数据湖架构

该架构(MinIO + Iceberg REST Catalog + Amoro + Trino)的设计融合了现代数据湖的核心需求,旨在实现‌存储解耦、计算灵活、管理自动化及高性能查询 ‌的综合目标。

一、核心设计理念

  1. 存储与计算分离
  • MinIO‌ 作为底层对象存储,提供高扩展、低成本的云原生存储能力,兼容 S3 API 简化多引擎接入。
  1. 统一元数据治理
  • Iceberg REST Catalog‌ 替代 Hive Metastore,提供标准化 RESTful 接口管理表元数据(如分区、Schema、快照)。
  • 优势‌:解耦元数据服务,避免单点故障,支持多引擎并发读写(Flink/Spark/Trino)。
  1. 自动化湖仓管理
  • Amoro ‌ 填补了 Iceberg 原生能力的空白,提供:
    • 小文件自动合并‌(通过 Flink 作业优化存储)
    • 多引擎协调‌(保证 Trino、Flink、Spark 的事务一致性)
    • 表生命周期管理‌(如分区清理、数据归档)
  1. 高性能分析查询
  • Trino ‌ 作为统一 SQL 查询层,支持:
    • 秒级响应复杂分析;
    • Iceberg 高级特性(时间旅行、增量扫描)

数据写入建议使用spark、flink等引擎直接通过iceberg rest catalog写入minio存储。可实现批流、实时流。

上一篇文章中是 trino直接访问amoro,amoro存在单一节点存在性能瓶颈,amoro还在孵化阶段,为了解决上面的问题,因此引入iceberg rest catalog 元数据管理,让amoro接管外部 External Catalog,trino直接配置访问 rest catalog。

另外,大家会问为什么数据查询分析不适用doris? 其实是可以的。考虑一点:doris数仓分析访问iceberg时,它有一个10分钟的元数据同步时间,会导致实时写入iceberg的数据,不能第一时间查询到。因此引入doris 会导致只能达到分钟级的实时数仓。

二、部署流程

以下是使用docker-compose搭建,可用于日常开发环境。

确保已安装Docker 27.0.3 和Docker Compose。

把下面的yaml保存到docker-compose.yml的文件中:

复制代码
version: "3"

services:
  minio:
    image: minio/minio
    container_name: minio
    networks:
      demo-iceberg:
        aliases:
          - warehouse.minio
    environment:
      - MINIO_ROOT_USER=admin
      - MINIO_ROOT_PASSWORD=password
      - MINIO_DOMAIN=minio
    ports:
      - 9001:9001
      - 9000:9000
    command: [ "server", "/data", "--console-address", ":9001" ]
  rest:
    image: tabulario/iceberg-rest
    container_name: iceberg-rest
    networks:
      demo-iceberg:
        aliases:
          - warehouse.rest
    ports:
      - 8181:8181
    environment:
      - AWS_ACCESS_KEY_ID=admin
      - AWS_SECRET_ACCESS_KEY=password
      - AWS_REGION=us-east-1
      - CATALOG_WAREHOUSE=s3://warehouse/
      - CATALOG_IO__IMPL=org.apache.iceberg.aws.s3.S3FileIO
      - CATALOG_S3_ENDPOINT=http://minio:9000
  amoro:
    image: apache/amoro
    container_name: amoro
    ports:
      - 8081:8081
      - 1630:1630
      - 1260:1260
    environment:
      - JVM_XMS=1024
    networks:
      demo-iceberg:
    volumes:
      - ./amoro:/tmp/warehouse
    command: ["/entrypoint.sh", "ams"]
    tty: true
    stdin_open: true
  trino:
    image: trinodb/trino:419
    container_name: trino
    environment:
      - AWS_ACCESS_KEY_ID=admin
      - AWS_SECRET_ACCESS_KEY=password
      - AWS_REGION=us-east-1
    volumes:
      - ./example.properties:/etc/trino/catalog/example.properties
    networks:
      demo-iceberg:
        aliases:
          - warehouse.trino
    ports:
      - 8080:8080
networks:
  demo-iceberg:
    ipam:
      driver: default

iceberg rest 镜像使用 tabulario/iceberg-rest。不要去使用iceberg官网上的 apache/iceberg-rest-fixture,会报错。

接下来,在docker-compose.yml所在的目录下创建example.properties文件:

复制代码
connector.name=iceberg
iceberg.catalog.type=rest
iceberg.rest-catalog.uri=http://<IP地址>:8181
fs.native-s3.enabled=true
s3.endpoint=http://<IP地址>:9000
s3.region=us-east-1
s3.aws-access-key=admin
s3.aws-secret-key=password

最后一步骤:使用以下命令启动docker容器:

复制代码
docker-compose up minio rest amoro

配置

minio 创建 bucket

打开http://localhost:9000在浏览器中,输入admin/password登录minio界面。

amoro 配置

Create optimizer group

Open http://localhost:1630 in a browser, enter admin/admin to log in to the dashboard.

Click on Optimizing in the sidebar, choose Optimizer Groups and click Add Group button to create a new group befre creating catalog

Create catalog

Click on Catalogs in the sidebar, click on the + button under Catalog List to create a test catalog, and name it to demo_catalog:

o use the Iceberg Format, select Type as External Catalog, and choose Metastore as Custom, and choose Iceberg as Table Format.

key catalog-impl in to org.apache.iceberg.rest.RESTCatalog

add key as uri in in to http://<rest ip address>:8181

这一步非常重要,请查看下面的图片填写。

按照上面配置的,修改example.properties文件。然后执行以下命令:

复制代码
docker-compose up trino

Demo steps

Initialize tables

Click on amoro system Terminal in the sidebar, you can create the test tables here using SQL. Terminal supports executing Spark SQL statements for now.

复制代码
CREATE DATABASE IF NOT EXISTS db;
CREATE TABLE IF NOT EXISTS db.tb_users (
    id INT,
    name string,
    ts TIMESTAMP
) 
PARTITIONED BY (days(ts));

INSERT OVERWRITE db.tb_users VALUES 
(1, "eric", timestamp("2022-07-01 12:32:00")),
(2, "frank", timestamp("2022-07-02 09:11:00")),
(3, "lee", timestamp("2022-07-02 10:11:00"));

SELECT * FROM db.tb_users;

Click on the RUN button uppon the SQL editor, and wait for the SQL query to finish executing. You can then see the query results under the SQL editor.

Initialize tables

start up the docker containers with this command:

复制代码
docker exec -it tirno trino

trino> show catalogs;
 Catalog 
---------
 example 
 jmx     
 memory  
 system  
 tpcds   
 tpch    
(6 rows)

trino> show schemas in example;
       Schema       
--------------------
 db                 
 information_schema 
(2 rows)

trino> show tables in example.db;
 Table 
-------
 tb_users
(1 row)


trino> select * from example.db.tb_users;
 id | name  |               ts               
----+-------+--------------------------------
  1 | eric  | 2022-07-01 12:32:00.000000 UTC  
  2 | frank | 2022-07-02 09:11:00.000000 UTC 
  3 | lee   | 2022-07-02 10:11:00.000000 UTC  
(3 rows)

到此为止,我们的架构就搭建完成。

关键注意事项

相关推荐
magic334165635 天前
Springboot整合MinIO文件服务(windows版本)
windows·spring boot·后端·minio·文件对象存储
分布式存储与RustFS7 天前
存算一体架构的先行者:RustFS在异构计算环境下的探索与实践
大数据·人工智能·物联网·云原生·对象存储·minio·rustfs
清静诗意8 天前
在 Ubuntu 上安装 MinIO 并使用 Python 封装类操作对象存储
服务器·minio
hzp6669 天前
Magnus:面向大规模机器学习工作负载的综合数据管理方法
人工智能·深度学习·机器学习·大模型·llm·数据湖·大数据存储
ApacheSeaTunnel11 天前
新兴数据湖仓手册·从分层架构到数据湖仓架构(2025):数据仓库分层的概念与设计
大数据·数据仓库·开源·数据湖·dataops·白鲸开源·底层技术
分布式存储与RustFS13 天前
告别复杂配置:用Milvus、RustFS和Vibe Coding,60分钟DIY专属Chatbot
wpf·文件系统·milvus·对象存储·minio·rustfs·vibe
分布式存储与RustFS16 天前
告别手动配置:用 Terraform 定义你的 RustFS 存储帝国
云原生·wpf·文件系统·terraform·对象存储·minio·rustfs
SirLancelot122 天前
MinIO-基本介绍(一)基本概念、特点、适用场景
后端·云原生·中间件·容器·aws·对象存储·minio
爱刘温柔的小猪1 个月前
Python 基于 MinIO 的文件上传服务与图像处理核心实践
python·minio
分布式存储与RustFS1 个月前
RustFS与其他新兴存储系统(如SeaweedFS)相比有哪些优势和劣势?
开源软件·文件系统·对象存储·minio·aws s3·seaweedfs·rustfs