Apache Atlas介绍
Apache Atlas是托管于Apache旗下的一款元数据管理和治理的产品,Apache Atlas提供api和一系列插件能够不便将数据库元数据信息导入到atlas中进行剖析,atlas也提供web界面对元数据进行治理,通过atlas,企业能够对数据库元数据建设资产目录,并对这些资产进行分类和治理,为数据分析,数据治理提供高质量的元数据信息。
什么是元数据
企业外部可能运行多种类型数据库,从大类上能够分,大数据平台,sql数据库,nosql数据库,图数据库等,从具体的数据库类型可能是mysql,oracle,mongodb等,不论是什么类型的数据库,终归都是一个目标,存储数据,对怎么治理数据每个数据库有每个数据库的形式,以oracle为例
- schema是一组数据库对象的汇合
- table是存储数据的实体
- column列示意数据库的每个属性
- view视图示意虚构表,示意一组查问的逻辑汇合
- materialview物化视图则是对视图的实体化
- 同义词示意数据库对象的别名
- …等等
那么schema,table,column这些形容数据的信息就是元数据,元数据库治理有什么用,咱们平时做开发可能很少会去思考这个问题,元数据管理对保障数据库品质是十分重要的,通过元数据管理
- 剖析表,视图等数据库对象间的依赖关系
- 剖析字段间的传递关系,在元数据库治理中,咱们称之为数据血缘关系
- 剖析是否存在反复字段,矛盾字段等
- 为企业提供数据地图
每个业务零碎可能会本人定义表,视图,这些数据从哪来又流往哪去,数据之间是否存在关联,和其余零碎的数据是否存在反复字段和矛盾字段,这些就是元数据管理要解决的问题。
apache atlas装置
Atlas目前只能自行编译源码进行装置,Atlas应用java开发,然而是以python形式启动,所以装置之前,环境必须满足以下需要
- jdk 1.8+
- maven3.x
- python2.7+
你能够从这里下载最新版本的Atlas代码,以2.1.0版本为例
$ tar -xvf apache-atlas-2.1.0-sources.tar.gz
$ cd apache-atlas-sources-2.1.0
$ mvn clean install
$ mvn clean -DskipTests package -Pdist,embedded-hbase-solr
装置相干依赖的过程可能会很长,有多长呢,大略一天左右吧,有时候还要迷信上下网能力下载下来,所以这货色不适宜急性子的人把玩
如果你看到了以下输入,祝贺你装置胜利
INFO] Reactor Summary:
[INFO]
[INFO] Apache Atlas Server Build Tools 1.0 ................ SUCCESS [ 0.904 s]
[INFO] apache-atlas 2.1.0 ................................. SUCCESS [ 7.481 s]
[INFO] Apache Atlas Test Utility Tools 2.1.0 .............. SUCCESS [ 6.085 s]
[INFO] Apache Atlas Integration 2.1.0 ..................... SUCCESS [ 7.561 s]
[INFO] Apache Atlas Common 2.1.0 .......................... SUCCESS [ 3.016 s]
[INFO] Apache Atlas Client 2.1.0 .......................... SUCCESS [ 0.334 s]
[INFO] atlas-client-common 2.1.0 .......................... SUCCESS [ 1.254 s]
[INFO] atlas-client-v1 2.1.0 .............................. SUCCESS [ 1.706 s]
[INFO] Apache Atlas Server API 2.1.0 ...................... SUCCESS [ 2.309 s]
[INFO] Apache Atlas Notification 2.1.0 .................... SUCCESS [ 4.108 s]
[INFO] atlas-client-v2 2.1.0 .............................. SUCCESS [ 1.118 s]
[INFO] Apache Atlas Graph Database Projects 2.1.0 ......... SUCCESS [ 0.202 s]
[INFO] Apache Atlas Graph Database API 2.1.0 .............. SUCCESS [ 1.349 s]
[INFO] Graph Database Common Code 2.1.0 ................... SUCCESS [ 1.351 s]
[INFO] Apache Atlas JanusGraph-HBase2 Module 2.1.0 ........ SUCCESS [ 1.747 s]
[INFO] Apache Atlas JanusGraph DB Impl 2.1.0 .............. SUCCESS [ 6.776 s]
[INFO] Apache Atlas Graph DB Dependencies 2.1.0 ........... SUCCESS [ 1.730 s]
[INFO] Apache Atlas Authorization 2.1.0 ................... SUCCESS [ 1.990 s]
[INFO] Apache Atlas Repository 2.1.0 ...................... SUCCESS [ 13.068 s]
[INFO] Apache Atlas UI 2.1.0 .............................. SUCCESS [ 44.313 s]
[INFO] Apache Atlas New UI 2.1.0 .......................... SUCCESS [ 42.839 s]
[INFO] Apache Atlas Web Application 2.1.0 ................. SUCCESS [01:13 min]
[INFO] Apache Atlas Documentation 2.1.0 ................... SUCCESS [ 1.562 s]
[INFO] Apache Atlas FileSystem Model 2.1.0 ................ SUCCESS [ 2.956 s]
[INFO] Apache Atlas Plugin Classloader 2.1.0 .............. SUCCESS [ 1.284 s]
[INFO] Apache Atlas Hive Bridge Shim 2.1.0 ................ SUCCESS [ 2.836 s]
[INFO] Apache Atlas Hive Bridge 2.1.0 ..................... SUCCESS [ 7.575 s]
[INFO] Apache Atlas Falcon Bridge Shim 2.1.0 .............. SUCCESS [ 1.455 s]
[INFO] Apache Atlas Falcon Bridge 2.1.0 ................... SUCCESS [ 2.289 s]
[INFO] Apache Atlas Sqoop Bridge Shim 2.1.0 ............... SUCCESS [ 0.244 s]
[INFO] Apache Atlas Sqoop Bridge 2.1.0 .................... SUCCESS [ 5.200 s]
[INFO] Apache Atlas Storm Bridge Shim 2.1.0 ............... SUCCESS [ 0.695 s]
[INFO] Apache Atlas Storm Bridge 2.1.0 .................... SUCCESS [ 2.701 s]
[INFO] Apache Atlas Hbase Bridge Shim 2.1.0 ............... SUCCESS [ 1.547 s]
[INFO] Apache Atlas Hbase Bridge 2.1.0 .................... SUCCESS [ 5.306 s]
[INFO] Apache HBase - Testing Util 2.1.0 .................. SUCCESS [ 2.853 s]
[INFO] Apache Atlas Kafka Bridge 2.1.0 .................... SUCCESS [ 2.156 s]
[INFO] Apache Atlas classification updater 2.1.0 .......... SUCCESS [ 0.955 s]
[INFO] Apache Atlas Impala Hook API 2.1.0 ................. SUCCESS [ 0.252 s]
[INFO] Apache Atlas Impala Bridge Shim 2.1.0 .............. SUCCESS [ 0.245 s]
[INFO] Apache Atlas Impala Bridge 2.1.0 ................... SUCCESS [ 3.901 s]
[INFO] Apache Atlas Distribution 2.1.0 .................... SUCCESS [ 01:08 h]
- 启动
$ cd apache-atlas-sources-2.1.0/distro/target/apache-atlas-2.1.0-server/apache-atlas-2.1.0/bin
$ python atlas_start.py
configured for local hbase.
hbase started.
configured for local solr.
solr started.
setting up solr collections...
starting atlas on host localhost
starting atlas on port 21000
..............................
Apache Atlas Server started!!!
在浏览器关上http://localhost:21000/如果你看到以下画面,阐明启动胜利
- 登录
默认用户名和明码是admin/admin
,登录后页面
装置示例(quick start)
Atlas安装包中提供两个我的项目的示例,如果你是想学习,这两个示例是很好的入门
$ cd apache-atlas-sources-2.1.0/distro/target/apache-atlas-2.1.0-server/apache-atlas-2.1.0/bin
$ python quick_start.py
$ python quick_start_v1.py
示例装置完登录http://localhost:21000
就能查问到两个示例到元数据信息
相干概念
- Type
元数据类型定义,这里能够是表,列,视图,物化视图等,还能够细分hive表(hive_table),hbase表(hbase_table)等,甚至能够是一个数据操作行为,比方定时同步从一张表同步到另外一张表这个也能够形容为一个元数据类型,atlas自带了很多类型,然而能够通过调用api自定义类型
- Classification
分类,艰深点就是给元数据打标签,分类是能够传递的,比方user_view这个视图是基于user这个表生成的,那么如果user打上了HR这个标签,user_view也会主动打上HR的标签,这样的益处就是便于数据的追踪
- GLOSSARY
词汇表,GLOSSARY蕴含两个概念,Category(类别)和Term(术语),Category示意一组Term的汇合,术语为元数据提供了别名,以便用户更好的了解数据,举个例子,有个pig的表,外面有个猪肾的字段,但很多人更习惯叫做猪腰子,那么就能够给猪肾这个字段加一个Term,不仅更好了解,也更容易搜寻到
- Entity
实体,示意具体的元数据,Atlas治理的对象就是各种Type的Entity
- Lineage
数据血统,示意数据之间的传递关系,通过Lineage咱们能够清晰的晓得数据的从何而来又流向何处,两头通过了哪些操作
UI界面
- Entity主界面
这里能够查看Entity详细信息,能够查看和增加分类,术语,查看和定义一些属性,标签
- 血缘关系
表sales_fact
通过loadSalesDaily
操作后生成表sales_fact_daily_mv
,再通过loadSalesMonthly
后生成表sales_fact_monthly_mv
,咱们能够看下sales_fact_monthly_mv
的血统图,能够发现该表源头数据不仅来自sales_fact还来自于time_dim
- 关联关系
能够查问表蕴含的列,数据库,起源,去向,存储,点击下面切换视图能够切换到图形模式
- 审计线索
记录对该对象的操作记录
导入hive表
atlas能够通过brige将元数据从数据库系统导入到atlas中,并且反对自动更新,目前从源码上看atlas反对的产品如下
$ ll apache-atlas-sources-2.1.0/addons/
drwxr-xr-x@ 6 asan staff 192 Jan 21 15:47 falcon-bridge/
drwxr-xr-x@ 6 asan staff 192 Jan 21 15:47 falcon-bridge-shim/
drwxr-xr-x@ 6 asan staff 192 Jan 21 15:47 hbase-bridge/
drwxr-xr-x@ 6 asan staff 192 Jan 21 15:47 hbase-bridge-shim/
drwxr-xr-x@ 6 asan staff 192 Jan 21 15:47 hbase-testing-util/
drwxr-xr-x@ 5 asan staff 160 Jan 21 15:47 hdfs-model/
drwxr-xr-x@ 6 asan staff 192 Jan 21 15:47 hive-bridge/
drwxr-xr-x@ 6 asan staff 192 Jan 21 15:47 hive-bridge-shim/
drwxr-xr-x@ 6 asan staff 192 Jan 21 15:47 impala-bridge/
drwxr-xr-x@ 6 asan staff 192 Jan 21 15:47 impala-bridge-shim/
drwxr-xr-x@ 6 asan staff 192 Jan 21 15:47 impala-hook-api/
drwxr-xr-x@ 6 asan staff 192 Jan 21 15:47 kafka-bridge/
drwxr-xr-x@ 7 asan staff 224 Jul 10 2020 models/
drwxr-xr-x@ 6 asan staff 192 Jan 21 15:47 sqoop-bridge/
drwxr-xr-x@ 6 asan staff 192 Jan 21 15:47 sqoop-bridge-shim/
drwxr-xr-x@ 6 asan staff 192 Jan 21 15:47 storm-bridge/
drwxr-xr-x@ 6 asan staff 192 Jan 21 15:47 storm-bridge-shim/
能够看到目前反对falcon,hbase,hive,impala,kafka,sqoop,storm数据库的导入,并且atlas自带有hive相干元数据类型
- 配置hive-site.xml
<property>
<name>hive.exec.post.hooks</name>
<value>org.apache.atlas.hive.hook.HiveHook</value>
</property>
- 批改hive-env.sh
export HIVE_AUX_JARS_PATH=/home/asan/apache-atlas-sources-2.1.0/distro/target/apache-atlas-2.1.0-hive-hook/apache-atlas-hive-hook-2.1.0/hook/hive
- 启动 import-hive.sh脚本
cd apache-atlas-sources-2.1.0/distro/target/apache-atlas-2.1.0-hive-hook/apache-atlas-hive-hook-2.1.0/hook-bin
./import-hive.sh
- 显示以下后果阐明导入胜利
Enter username for atlas :- admin
Enter password for atlas :-
Hive Meta Data imported successfully!!!
参考文档
- https://manjitsingh664.medium.com/apache-atlas-installation-guide-9098df98d5c3
发表回复