首页 > 技术文章 > Apache Atlas

yue31313 2018-10-16 23:23 原文

atlas
英 [ˈætləs] 阿特拉斯。 美 [ˈætləs]
n.
地图集;〈比喻〉身负重担的人

==

Apache Atlas

Version: 1.1.0

Last Published: 2018-09-18

 版本:1.1.0  最新出版:2018-09-18

==

Data Governance and Metadata framework for Hadoop

Hadoop的数据管理和元数据框架

Overview

概述

Atlas is a scalable and extensible set of core foundational governance services – enabling enterprises to effectively and efficiently meet their compliance requirements within Hadoop and allows integration with the whole enterprise data ecosystem.

 

Atlas是一组可伸缩和可扩展的核心基础治理服务——使企业能够有效和高效地满足Hadoop中的遵从性需求,并允许与整个企业数据生态系统进行集成。

 

Apache Atlas provides open metadata management and governance capabilities for organizations to build a catalog of their data assets, classify and govern these assets and provide collaboration capabilities around these data assets for data scientists, analysts and the data governance team.

 

Apache Atlas为组织提供开放的元数据管理和治理能力,以建立其数据资产的目录,对这些资产进行分类和管理,并为数据科学家、分析师和数据治理团队提供围绕这些数据资产的协作能力。

 

Features

特征

Metadata types & instances

 元数据类型和实例

  • Pre-defined types for various Hadoop and non-Hadoop metadata
  • Ability to define new types for the metadata to be managed
  • Types can have primitive attributes, complex attributes, object references; can inherit from other types
  • Instances of types, called entities, capture metadata object details and their relationships
  • REST APIs to work with types and instances allow easier integration

 

  • 各种Hadoop和非Hadoop元数据的预定义类型
  • 为要管理的元数据定义新类型的能力
  • 类型可以具有原始属性、复杂属性、对象引用;可以从其他类型继承。
  • 类型的实例,称为实体,捕获元数据对象细节及其关系
  • REST API与类型和实例一起工作更容易集成

 

Classification

 分类

  • Ability to dynamically create classifications - like PII, EXPIRES_ON, DATA_QUALITY, SENSITIVE
  • Classifications can include attributes - like expiry_date attribute in EXPIRES_ON classification
  • Entities can be associated with multiple classifications, enabling easier discovery and security enforcement
  • Propagation of classifications via lineage - automatically ensures that classifications follow the data as it goes through various processing

 

  • 动态创建分类的能力,如PII、ExIPRESION、DATAAL质量、敏感
  • 分类可以包括属性,如EXPIRES_ON分类中的expiry_date 属性
  • 实体可以与多个分类相关联,从而能够更容易地发现和安全执行。
  • 通过谱系传播分类-自动确保分类跟随数据经过各种处理

 

Lineage

 血统

  • Intuitive UI to view lineage of data as it moves through various processes
  • REST APIs to access and update lineage

 

  • 直观的UI,以查看数据的传承,因为它通过各种处理
  • REST API访问和更新血统

Search/Discovery

 搜索/发现

  • Intuitive UI to search entities by type, classification, attribute value or free-text
  • Rich REST APIs to search by complex criteria
  • SQL like query language to search entities - Domain Specific Language (DSL)

 

  • 通过类型、分类、属性值或自由文本搜索实体的直观UI
  •  丰富的 REST API 实现复杂的标准搜索
  • 搜索实体的SQL类查询语言——领域特定语言(DSL)

Security & Data Masking

 安全与数据屏蔽

  • Fine grained security for metadata access, enabling controls on access to entity instances and operations like add/update/remove classifications
  • Integration with Apache Ranger enables authorization/data-masking on data access based on classifications associated with entities in Apache Atlas. For example:
    • who can access data classified as PII, SENSITIVE
    • customer-service users can only see last 4 digits of columns classified as NATIONAL_ID

 

  • 用于元数据访问的细粒度安全性,允许对实体实例和操作(如添加/更新/删除分类)的访问进行控制
  • 与Apache Ranger的集成使得基于与Apache Atlas中的实体相关联的分类的数据访问的授权/数据屏蔽成为可能。例如:

                  谁可以访问被分类为PII、敏感的数据

                  客户服务用户只能看到被列为国家标识的列的最后4位数字

Getting Started

 入门

 

  • Apache阿特拉斯1.1有什么新鲜事?
  • 建造与安装
  • 快速启动

Documentation

 文档

 

  • REST API文档
  • 进出口API文档
  • 遗留API文档

 

Developer Setup Documentation

 开发者安装文档

Licensing Information

许可证信息

Atlas is distributed under Apache License 2.0

阿特拉斯在Apache许可证2.0下发布

==

大数据元数据和数据管理框架
Apache Atlas实践
atlas的强大的血缘关系管理能力震撼
 
•Apache Atlas简介
•Apache Atlas架构
•Titan图数据库介绍
•ApachAtlas配置
•Apache Atlas案例
•总结
 

Apache Atlas简介
•面对海量且持续增加的各式各样的数据对象,你是否有信心知道哪些数据从哪里来以及它如何随时间而变化?采用Hadoop必须考虑数据管理的实际情况,元数据与数据治理成为企业级数据湖的重要部分
•为寻求数据治理的开源解决方案,Hortonworks公司联合其他厂商与用户于2015年发起数据治理倡议,包括数据分类、集中策略引擎、数据血缘、安全和生命周期管理等方面。Apache Atlas 项目就是这个倡议的结果,社区伙伴持续的为该项目提供新的功能和特性。该项目用于管理共享元数据、数据分级、审计、安全性以及数据保护等方面,努力与Apache Ranger整合,用于数据权限控制策略。
---------------------

Atlas主要功能
•数据分类
        定义、注释和自动捕获数据集和底层之间的关系元素包括源、目标和派生过程

•安全审计
        数据访问的日志审计

•搜索和血缘关系
       元数据信息及数据之间的血缘

•安全与策略引擎
       结合ApacheRanger来设置数据的访问权限
---------------------

Atlas架构
==

Atlas Core
•Type System:Atlas 允许用户为他们想要管理的元数据对象定义一个模型。该模型由称为“类型” 的定义组成。“类型” (类)的 实例被称为 “实体” 表示被管理的实际元数据对象。类型系统是一个组件,允许用户定义和管理类型和实体。由 Atlas 管理的所有元数据对象(例如Hive表)都使用类型进行建模,并表示为实体(类对象,一条数据)。
•Ingest / Export:Ingest 组件允许将元数据添加到 Atlas。类似地,Export 组件暴露由 Atlas 检测到的元数据更改,以作为事件引发,消费者可以使用这些更改事件来实时响应元数据更改。
•Graph Engine :在内部,Atlas 通过使用图形模型管理元数据对象。以实现元数据对象之间的巨大灵活性和丰富的关系。图形引擎是负责在类型系统的类型和实体之间进行转换的组件,以及基础图形模型。除了管理图形对象之外,图形引擎还为元数据对象创建适当的索引,以便有效地搜索它们

---------------------

如何使用Atlas管理
   用户可以使用两种方法管理 Atlas中的元数据

•API:Atlas 的所有功能通过REST API 提供给最终用户,允许创建,更新和删除类型和实体。它也是查询和发现通过Atlas 管理的类型和实体的主要方法。
    https://cwiki.apache.org/confluence/display/ATLAS/Atlas+REST+API

•Messaging:除了 API 之外,用户还可以选择使用基于 Kafka 的消息接口与 Atlas 集成。这对于将元数据对象传输到 Atlas 以及从 Atlas 使用可以构建应用程序的元数据更改事件都非常有用。如果希望使用与 Atlas 更松散耦合的集成,这可以允许更好的可扩展性,可靠性等,消息传递接口是特别有用的。Atlas 使用 Apache Kafka 作为通知服务器用于钩子和元数据通知事件的下游消费者之间的通信。事件由钩子和 Atlas 写到不同的 Kafka 主题。


Titan介绍

•Titan:目前,Atlas 使用 Titan 图数据库来存储元数据对象。 Titan 使用两个存储:默认情况下元数据存储配置为 HBase,索引存储配置为 Solr。也可以通过构建相应的配置文件将元数据存储作为 BerkeleyDB和 Index 存储使用为 ElasticSearch。元数据存储用于存储元数据对象本身,并且索引存储用于存储元数据属性的索引,其允许高效搜索。
•目前基于Java使用最广泛的有两个开源框架
  (1) neo4j

  社区版 免费

  企业版 收费

    (2) Titan

  全开源

 Titan是一个分布式的图数据库,支持横向扩展,可容纳数千亿个顶点和边。 Titan支持事务,并且可以支撑上千并发用户和 计算复杂图形遍历。

 


安装

在安装前需要确定,你运行titan的Java环境为1.8+ *

1) 将安装包拷贝到安装位置后解压缩:

unzip titan-1.0.0-hadoop2.zip

2) 删除并添加相关jar包

官方提供的hadoop2的安装包有一些问题,如果想要顺利的使用titan,必须删除相关的jar包,并添加一些缺失的jar包:

a. 删除异常jar包

hadoop-core-1.2.1.jar

b. 添加所需要的jar包,这些jar包可以通过maven进行下载

titan-hadoop-1.0.0.jar

titan-hadoop-core-1.0.0.jar


启动

•titan安装后,使用默认配置启动titan服务。
•默认情况下,titan会启动三个服务:

•Cassandra 作为后端数据库存储图数据
•Elasticsearch作为索引,提高图的检索效率
•Gremlin-Server 图数据库引擎,支持gremlin数据查询语法

 

测试

./bin/gremlin.sh

:remote connect tinkerpop.serverconf/remote.yaml


//初始化

graph=TitanFactory.open('conf/titan-cassandra-es.properties')

GraphOfTheGodsFactory.load(graph)

g=graph.traversal()


//获取saturn点

saturn=g.V().has('name', 'saturn').next()

g.V(saturn).valueMap()


//查看saturn孙子

g.V(saturn).in('father').in('father').values('name')

 

//查看hercules父母

hercules = g.V().has('name', 'hercules').next()

g.V(hercules).out('father', 'mother').values('name')


Atlas配置
1,Atlas安装后默认hbase和solr存储,如果想修改存储介质,需要修改

/usr/hdp/2.6.0.3-8/atlas/conf/atlas-application.properties

 

 

2,Atlas安装完之后会在hive-site.xml文件中插入,是一个钩子函数

 

Hive 在使用 hive hook 的hive 命令执行上支持侦听器。 这用于在 Atlas 中使用org.apache.atlas.hive.model.HiveDataModelGenerator 中定义的模型添加/更新/删除实体。 hive hook将请求提交给线程池执行器,以避免阻塞命令执行。 线程将实体作为消息提交给通知服务器,并且服务器读取这些消息并注册实体。

 

3,如果Atlas中没有元数据,需要手动执行

/usr/hdp/2.6.0.3-8/atlas/hook-bin/import-hive.sh

 

4,Atlas高可用

要在 Atlas 中设置高可用性,必须在 atlas-application.properties文件中定义一些配置选项。

•高可用性是Atlas 的可选功能。因此,必须通过将配置选项atlas.server.ha.enabled设置为true 来启用。
•接下来,定义标识符列表,为您为 Atlas Web Service 实例选择的每个物理机器分配一个标识符。这些标识符可以是简单的字符串,如id1,id2等。它们应该是唯一的,不应包含逗号。
•将这些标识符的逗号分隔列表定义为选项 atlas.server.ids的值。
•对于每个物理机,请列出IP地址/主机名和端口作为配置 atlas.server.address.id的值,其中 id指的是此物理机的标识符字符串。

•例如,如果您选择了 2台主机名为 http://host1.company.com和 http://host2.company.com的计算机,则可以如下定义配置选项:
•  atlas.server.ids=id1,id2
• atlas.server.address.id1=host1.company.com:21000
• atlas.server.address.id2=host2.company.com:21000
•定义使用的 Zookeeper为 Atlas提供高可用性功能
atlas.server.ha.zookeeper.connect=zk1.company.com:2181,zk2.company.com:2181,zk3.comp

•要验证高可用性是否正常工作,请在安装了 Atlas Web Service 的每个实例上运行以下脚本。
   $ATLAS_HOME/bin/atlas_admin.py -status

 

以下hive 操作由 hive hook 当前捕获

create database

create table/view, create table as select

load, import, export

DMLs (insert)

alter database

alter table (skewed table information, stored as, protection is notsupported)

alter view


案例


REST API
http://192.168.200.13:21000/api/atlas/lineage/hive/table/stg.stg_device_info_d@test/inputs/graph   

http://192.168.200.13:21000/api/atlas/lineage/hive/table/stg.stg_device_info_d@test/outputs/graph

注意:已经删除的表,RESTAPI不能查询,但是图形化工具可以查询


总结
ApacheAtlas可监控数据的流向

ApacheRanger统一授权管理


---------------------

大数据治理系统框架Apache Atlas实践 - CSDN博客

==

Atlas 中文文档

https://blog.csdn.net/m0_38103873/article/details/79959482

为初学者开发Atlas提供中文版文档,在安装Atlas后,会自动生成英文版文档,为了便于初学者更好地理解Atlas,特将此翻译成中文版下面为部分目录,资源连接点击打开链接

==

《大数据治理与服务》PDF版

点击下载: 
《大数据治理与服务》 
这里写图片描述

==

大数据安全规范

 

 

推荐阅读