Datahub中文社区

    • Register
    • Login
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • 达之云

    开源软件Datahub中文社区

    微信号:DatahubCN

    QQ群:528386897

    元数据高级:计划摄入

    操作指南
    3
    3
    1478
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      dazdata last edited by

      1、命令行方式
      给定一个配置文件./home/ubuntu/datahub_ingest/mysql_to_datahub.yml

      source:
      type: mysql
      config:
      # Coordinates
      host_port: localhost:3306
      database: dbname

      # Credentials
      username: root
      password: example
      

      sink:
      type: datahub-rest
      config:
      server: http://localhost:8080

      我们可以使用Datahub CLI 摄取元数据,如下所示

      datahub ingest -c /home/ubuntu/datahub_ingest/mysql_to_datahub.yml

      这将从配置文件中配置的源中摄取元数据。这执行一次引入。随着源系统的变化,我们希望将更改反映在Datahub中。为此,有人需要使用配方文件重新运行摄取命令。

      2、使用 Cron
      假设您的机器上有一个配置文件/home/ubuntu/datahub_ingest/mysql_to_datahub.yml

      source:
      type: mysql
      config:
      # Coordinates
      host_port: localhost:3306
      database: dbname

      # Credentials
      username: root
      password: example
      

      sink:
      type: datahub-rest
      config:
      server: http://localhost:8080

      我们可以使用 crontab 将摄取安排为每天午夜后五分钟运行,使用 DataHub CLI。

      5 0 * * * datahub ingest -c /home/ubuntu/datahub_ingest/mysql_to_datahub.yml

      3、使用Airflow
      如果您使用 Apache Airflow 进行调度,那么您可能还希望使用它来调度您的摄取配方。

      我们提供了一些有关如何配置 DAG 的示例:

      mysql_sample_dag将完整的 MySQL 引入配置嵌入到 DAG 中。

      snowflake_sample_dag避免在配方中嵌入凭据,而是从Airflow的连接功能中获取它们。您必须在 Airflow 中配置连接才能使用此方法。

      4、使用 Kubernetes
      如果您使用k8s部署了数据中心,则可以使用 用于计划引入的Datahub引入 cron 子图表。

      下面是该配置在 values.yaml 中的外观示例:

      datahub-ingestion-cron:
      enabled: true
      crons:
      mysql:
      schedule: “0 * * * *” # Every hour
      recipe:
      configmapName: recipe-config
      fileName: mysql_recipe.yml

      这假设预先存在一个 Kubernetes ConfigMap,该 ConfigMap 将所有配置保存在与 cron 作业将运行的位置。

      一个例子可以是:

      apiVersion: v1
      kind: ConfigMap
      metadata:
      name: recipe-config
      data:
      mysql_recipe.yml: |-
      source:
      type: mysql
      config:
      # Coordinates
      host_port: :3306
      database: dbname

          # Credentials
          username: root
          password: example
      
      sink:
        type: datahub-rest
        config:
          server: http://<GMS_HOST>:8080
      
      1 Reply Last reply Reply Quote 0
      • M
        maol last edited by

        为什么我摄取mysql的元数据后,界面上还是未显示

        1 Reply Last reply Reply Quote 0
        • A
          aiu last edited by

          怎么用java sdk创建表级血缘呢

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Powered by dazdata MDS | 武汉达之云计算有限公司