Apache Atlas

推荐文献

http://atlas.apache.org/Architecture.html
https://www.sohu.com/a/215119883_692358

数据血缘

其实,在我理解中,就是一个数据的全生命周期的管理,从采集到处理,拆分,过滤,整合,存储,到废弃。数据和数据之间可以相互转化,这种转化关系就是数据之间的血缘。
精细的数据血缘应该是字段级别的,如果做不到,做成表级别也可以。

架构

在这里插入图片描述

  • Type System: Atlas 允许用户为他们想要管理的元数据对象定义一个模型。该模型由称为 “类型” 的定义组成。“类型” 的 实例被称为 “实体” 表示被管理的实际元数据对象。类型系统是一个组件,允许用户定义和管理类型和实体。由 Atlas 管理的所有元数据对象(例如Hive表)都使用类型进行建模,并表示为实体。

  • Ingest/Export:Ingest 组件允许将元数据添加到 Atlas。类似地,Export 组件暴露由 Atlas 检测到的元数据更改,以作为事件引发,可以通过kafka推送给下游组件,消费者可以使用这些更改事件来实时响应元数据更改。

  • Graph Engine:在内部,Atlas 通过使用图形模型管理元数据对象。以实现元数据对象之间的巨大灵活性和丰富的关系。图形引擎是负责在类型系统的类型和实体之间进行转换的组件,以及基础图形模型。除了管理图形对象之外,图形引擎还为元数据对象创建适当的索引,以便有效地搜索它们。

  • JanusGraph是一个开源的分布式图数据库。它具有很好的扩展性,通过多机集群可支持存储和查询数百亿的顶点和边的图数据

  • JanusGraph使用两个存储:默认情况下元数据存储配置为 HBase ,索引存储配置为 Solr。也可以通过构建相应的配置文件使用BerkeleyDB存储元数据存储 和使用ElasticSearch存储 Index。元数据存储用于存储元数据对象本身,索引存储用于存储元数据属性的索引,其允许高效搜索。

概念

type

type相当于java中的类。
举一个type定义如下

 Name: hive_table
  MetaType: Class//该type的类型。支持Class,Struct,Trait,Array,Map,Int,String,Boolean等。
  SuperTypes: DataSet//相当于java的extend。因为我们定义hive表,所以从继承的
  Attributes:
      name: String (name of the table) //属性可以看成一个key-value。但实际上,属性有自己的内置属性。见下面
      db: Database object of type hive_db
      owner: String
      createTime: Date
      lastAccessTime: Date
      comment: String
      retention: int
      sd: Storage Description object of type hive_storagedesc
      partitionKeys: Array of objects of type hive_column
      aliases: Array of strings
      columns: Array of objects of type hive_column
      parameters: Map of String keys to String values
      viewOriginalText: String
      viewExpandedText: String
      tableType: String
      temporary: Boolean

entity

定义一张具体hive表实体的例子如下

 id: "9ba387dd-fa76-429c-b791-ffc338d3c91f"//向atlas定义对象时生成的唯一GUID。用于唯一表示该对象
  typeName: “hive_table”
  values:
      name: "customers"
      db: "b42c6cfc-c1e7-42fd-a9e6-890e0adf33bc"
      owner: "admin"
      createTime: "2016-06-20T06:13:28.000Z"
      lastAccessTime: "2016-06-20T06:13:28.000Z"
      comment: null
      retention: 0
      sd: "ff58025f-6854-4195-9f75-3a3058dd8dcf"
      partitionKeys: null
      aliases: null
      columns: ["65e2204f-6a23-4130-934a-9679af6a211f", "d726de70-faca-46fb-9c99-cf04f6b579a6", ...]
      parameters: {"transient_lastDdlTime": "1466403208"}
      viewOriginalText: null
      viewExpandedText: null
      tableType: "MANAGED_TABLE"
      temporary: false

属性

属性有自己的内置属性(属性的属性?)以上面的db和columns,其属性的定义如下

db:
      "dataTypeName": "hive_db",
      "isComposite": false,
      "isIndexable": true,
      "isUnique": false,
      "multiplicity": "required",
      "name": "db",
      "reverseAttributeName": null

  columns:
      "dataTypeName": "array<hive_column>",
      "isComposite": true,
      "isIndexable": true,
      “isUnique": false,
      "multiplicity": "optional",
      "name": "columns",
      "reverseAttributeName": null

安装

我们采用1.1.0版本。我司使用的架构是HDP(2.6)+ambari(2.5.2)。通过ambari最多能安装Atlas的0.0.8版本。岂可修,我们必须要手动安装。

相关配置文件如下

  • users-credentials.properties 存储对应的用户名和密码。格式username=group::sha256-password。
  • atlas-simple-authz-policy.json 对应用户的用户名和角色,权限范围
  • atlas-application.properties 对应具体配置,下面详解。

加密配置部分

我们采用简单的用户名密码配置

######### Atlas Authorization #########
atlas.authorizer.impl=simple
atlas.authorizer.simple.authz.policy.file=atlas-simple-authz-policy.json

#### user credentials file
atlas.authentication.method.file.filename=${sys:atlas.home}/conf/users-credentials.properties

rest服务地址

#########  Server Properties  #########
atlas.rest.address=http://localhost:21000

存储配置

索引存储,我们使用solr作为索引存储,HBase作为元数据存储

  • solr
# Graph Search Index
atlas.graph.index.search.backend=solr5
atlas.graph.index.search.solr.mode=cloud
 atlas.graph.index.search.solr.zookeeper-url=<the ZK quorum setup for solr as comma separated value> eg: 10.1.6.4:2181,10.1.6.5:2181
 atlas.graph.index.search.solr.zookeeper-connect-timeout=<SolrCloud Zookeeper Connection Timeout>. Default value is 60000 ms
 atlas.graph.index.search.solr.zookeeper-session-timeout=<SolrCloud Zookeeper Session Timeout>. Default value is 60000 ms
  • hbase
# Graph Storage
# Set atlas.graph.storage.backend to the correct value for your desired storage
# backend. Possible values:
#
# hbase
# cassandra
# embeddedcassandra - Should only be set by building Atlas with  -Pdist,embedded-cassandra-solr
# berkeleyje
#
# See the configuration documentation for more information about configuring the various  storage backends.
#
atlas.graph.storage.backend=hbase
atlas.graph.storage.hbase.table=atlas

atlas.graph.cache.db-cache = true
atlas.graph.cache.db-cache-clean-wait = 20
atlas.graph.cache.db-cache-size = 0.5

#Hbase
#For standalone mode , specify localhost
#for distributed mode, specify zookeeper quorum here
atlas.graph.storage.hostname=<ZooKeeper Quorum>
atlas.graph.storage.hbase.regions-per-server=1
atlas.graph.storage.lock.wait-time=10000

完成上述必要配置后。我们就可以开始了。

应用

和apache ranger进行整合。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值