




已阅读5页,还剩17页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
尚硅谷大数据技术之Atlas(元数据管理)尚硅谷大数据技术之Atlas(元数据管理)(作者:尚硅谷大数据研发部)版本:V2.0第1章 Atlas入门1.1 Atlas概述Apache Atlas为组织提供开放式元数据管理和治理功能,用以构建其数据资产目录,对这些资产进行分类和管理,并为数据分析师和数据治理团队,提供围绕这些数据资产的协作功能。1)表与表之间的血缘依赖2)字段与字段之间的血缘依赖1.2 Atlas架构原理第2章 Atlas安装及使用1)Atlas官网地址:/2)文档查看地址:/0.8.4/index.html3)下载地址:/dyn/closer.cgi/atlas/0.8.4/apache-atlas-0.8.4-sources.tar.gz2.1 安装前环境准备Atlas安装分为:集成自带的HBase + Solr;集成外部的HBase + Solr。通常企业开发中选择集成外部的HBase + Solr,方便项目整体进行集成操作。服务名称子服务服务器hadoop102服务器hadoop103服务器hadoop104HDFSNameNodeDataNodeSecondaryNameNodeYarnNodeManagerResourcemanagerZookeeperQuorumPeerMainKafkaKafkaHBaseHMasterHRegionServerSolrJarHiveHiveMySQLMySQLAzkabanAzkabanWebServerAzkabanExecutorServerAtlasatlas服务数总计13772.1.1 安装JDK8、Hadoop2.7.21)安装Hadoop集群2)启动Hadoop集群atguiguhadoop102 hadoop-2.7.2$ sbin/start-dfs.shatguiguhadoop103 hadoop-2.7.2$ sbin/start-yarn.sh2.1.2 安装Zookeeper3.4.101)安装Zookeeper集群2)启动Zookeeper集群atguiguhadoop102 zookeeper-3.4.10$ zk.sh start2.1.3 安装Kafka1)安装Kafka集群2)启动Kafka集群atguiguhadoop102 kafka$ kf.sh start2.1.4 安装Hbase1.3.11)安装Hbase集群2)启动Hbase集群atguiguhadoop102 hbase$ bin/start-hbase.sh2.1.5 安装Solr5.2.11)Solr版本要求必须是5.2.1,见官网2)Solr下载:/dist/lucene/solr/5.2.1/solr-5.2.1.tgz3)把solr-5.2.1.tgz上传到hadoop102的/opt/software目录下4)解压solr-5.2.1.tgz到/opt/module/目录下面atguiguhadoop102 software$ tar -zxvf solr-5.2.1.tgz -C /opt/module/5)修改solr-5.2.1的名称为solratguiguhadoop102 module$ mv solr-5.2.1/ solr6)进入solr/bin目录,修改solr.in.sh文件atguiguhadoop102 solr$ vim bin/solr.in.sh#添加下列指令ZK_HOST=hadoop102:2181,hadoop103:2181,hadoop104:2181SOLR_HOST=hadoop102# Sets the port Solr binds to, default is 8983#可修改端口号SOLR_PORT=89837)分发Solr,进行Cloud模式部署atguiguhadoop102 module$ xsync solr提示:分发完成后,分别对hadoop103、hadoop104主机/opt/module/solr/bin下的solr.in.sh文件,修改为SOLR_HOST=对应主机名。8)在三台节点上分别启动Solr,这个就是Cloud模式atguiguhadoop102 solr$ bin/solr start atguiguhadoop103 solr$ bin/solr start atguiguhadoop104 solr$ bin/solr start 提示:启动Solr前,需要提前启动Zookeeper服务。9)Web访问8983端口,可指定三台节点中的任意一台IP,http:/hadoop102:8983/solr/#/提示:UI界面出现Cloud菜单栏时,Solr的Cloud模式才算部署成功。10)编写Solr启动停止脚本(1)在hadoop102的/home/atguigu/bin目录下创建脚本atguiguhadoop102 bin$ vim s.sh在脚本中编写如下内容#!/bin/bashcase $1 instart) for i in hadoop102 hadoop103 hadoop104 do ssh $i /opt/module/solr/bin/solr start done;stop) for i in hadoop102 hadoop103 hadoop104 do ssh $i /opt/module/solr/bin/solr stop done;esac(2)增加脚本执行权限atguiguhadoop102 bin$ chmod 777 s.sh(3)Solr集群启动脚本atguiguhadoop102 module$ s.sh start(4)Solr集群停止脚本atguiguhadoop102 module$ s.sh stop2.1.6 安装Hive.7 安装Azkaban2.5.0如果采用的Hive2.3.6版本,Azkaban需要在启动脚本中将hive的环境变量注释掉。2.1.8 安装Atlas0.8.41)把apache-atlas-0.8.4-bin.tar.gz上传到hadoop102的/opt/software目录下2)解压apache-atlas-0.8.4-bin.tar.gz到/opt/module/目录下面atguiguhadoop102 software$ tar -zxvf apache-atlas-0.8.4-bin.tar.gz -C /opt/module/3)修改apache-atlas-0.8.4的名称为atlasatguiguhadoop102 module$ mv apache-atlas-0.8.4/ atlas2.2 Atlas集成外部框架2.2.1 Atlas集成Hbase 1)进入/opt/module/atlas/conf/目录,修改配置文件atguiguhadoop102 conf$ vim perties #修改atlas存储数据主机atlas.graph.storage.hostname=hadoop102:2181,hadoop103:2181,hadoop104:21812)进入到/opt/module/atlas/conf/hbase路径,添加Hbase集群的配置文件到$Atlas_Homeatguiguhadoop102 hbase$ ln -s /opt/module/hbase/conf/ /opt/module/atlas/conf/hbase/3)在/opt/module/atlas/conf/atlas-env.sh中添加HBASE_CONF_DIRatguiguhadoop102 conf$ vim atlas-env.sh#添加HBase配置文件路径export HBASE_CONF_DIR=/opt/module/atlas/conf/hbase/conf2.2.2 Atlas集成Solr 1)进入/opt/module/atlas/conf目录,修改配置文件atguiguhadoop102 conf$ vim perties #修改如下配置atlas.graph.index.search.solr.zookeeper-url=hadoop102:2181,hadoop103:2181,hadoop104:21812)将Atlas自带的Solr文件夹拷贝到外部Solr集群的各个节点。atguiguhadoop102 conf$ cp -r /opt/module/atlas/conf/solr /opt/module/solr/3)进入到/opt/module/solr路径,修改拷贝过来的配置文件名称为atlas_confatguiguhadoop102 solr$ mv solr atlas_conf4)在Cloud模式下,启动Solr(需要提前启动Zookeeper集群),并创建collectionatguiguhadoop102 solr$ bin/solr create -c vertex_index -d /opt/module/solr/atlas_conf -shards 3 -replicationFactor 2atguiguhadoop102 solr$ bin/solr create -c edge_index -d /opt/module/solr/atlas_conf -shards 3 -replicationFactor 2atguiguhadoop102 solr$ bin/solr create -c fulltext_index -d /opt/module/solr/atlas_conf -shards 3 -replicationFactor 2-shards 3:表示该集合分片数为3-replicationFactor 2:表示每个分片数都有2个备份vertex_index、edge_index、fulltext_index:表示集合名称注意:如果需要删除vertex_index、edge_index、fulltext_index等collection可以执行如下命令。atguiguhadoop102 solr$ bin/solr delete -c $collection_name5)验证创建collection成功登录solr web控制台:http:/hadoop102:8983/solr/#/cloud 看到如下图显示:2.2.3 Atlas集成Kafka 1)进入/opt/module/atlas/conf/目录,修改配置文件pertiesatguiguhadoop102 conf$ vim perties # Notification Configs #atlas.notification.embedded=falseatlas.kafka.zookeeper.connect=hadoop102:2181,hadoop103:2181,hadoop104:2181atlas.kafka.bootstrap.servers=hadoop102:9092,hadoop103:9092,hadoop104:9092atlas.kafka.zookeeper.session.timeout.ms=4000atlas.kafka.zookeeper.connection.timeout.ms=2000mit=true2)启动Kafka集群,并创建Topicatguiguhadoop102 kafka$ bin/kafka-topics.sh -zookeeper hadoop102:2181,hadoop103:2181,hadoop104:2181 -create -replication-factor 3 -partitions 3 -topic _HOATLASOKatguiguhadoop102 kafka$ bin/kafka-topics.sh -zookeeper hadoop102:2181,hadoop103:2181,hadoop104:2181 -create -replication-factor 3 -partitions 3 -topic ATLAS_ENTITIES2.2.4 Atlas其他配置1)进入/opt/module/atlas/conf/目录,修改配置文件pertiesatguiguhadoop102 conf$ vim perties # Server Properties #atlas.rest.address=http:/hadoop102:21000# If enabled and set to true, this will run setup steps when the server startsatlas.server.run.setup.on.start=false# Entity Audit Configs #atlas.audit.hbase.zookeeper.quorum=hadoop102:2181,hadoop103:2181,hadoop104:21812)记录性能指标,进入/opt/module/atlas/conf/路径,修改当前目录下的atlas-log4j.xmlatguiguhadoop102 conf$ vim atlas-log4j.xml#去掉如下代码的注释 2.2.5 Atlas集成Hive1)进入/opt/module/atlas/conf/目录,修改配置文件pertiesatguiguhadoop102 conf$ vim perties # Hive Hook Configs #atlas.hook.hive.synchronous=falseatlas.hook.hive.numRetries=3atlas.hook.hive.queueSize=10000=primary2)将perties配置文件加入到atlas-plugin-classloader-1.0.0.jar中 atguiguhadoop102 hive$ zip -u /opt/module/atlas/hook/hive/atlas-plugin-classloader-0.8.4.jar /opt/module/atlas/conf/pertiesatguiguhadoop102 hive$ cp /opt/module/atlas/conf/perties /opt/module/hive/conf/原因:这个配置不能参照官网,将配置文件考到hive的conf中。参考官网的做法一直读取不到perties配置文件,看了源码发现是在classpath读取的这个配置文件,所以将它压到jar里面。3)在/opt/module/hive/conf/hive-site.xml文件中设置Atlas hookatguiguhadoop102 conf$ vim hive-site.xml hive.exec.post.hooks org.apache.atlas.hive.hook.HiveHookatguiguhadoop102 conf$ vim hive-env.sh#在tez引擎依赖的jar包后面追加hive插件相关jar包export HIVE_AUX_JARS_PATH=/opt/module/hadoop-2.7.2/share/hadoop/common/hadoop-lzo-0.4.20.jar$TEZ_JARS,/opt/module/atlas/hook/hive/atlas-plugin-classloader-0.8.4.jar,/opt/module/atlas/hook/hive/hive-bridge-shim-0.8.4.jar2.3 集群启动1)启动Hadoop集群atguiguhadoop102 hadoop-2.7.2$ sbin/start-dfs.shatguiguhadoop103 hadoop-2.7.2$ sbin/start-yarn.sh2)启动Zookeeper集群atguiguhadoop102 zookeeper-3.4.10$ zk.sh start3)启动Kafka集群atguiguhadoop102 kafka$ kf.sh start4)启动Hbase集群:atguiguhadoop102 hbase$ bin/start-hbase.sh5)启动Solr集群atguiguhadoop102 solr$ bin/solr startatguiguhadoop103 solr$ bin/solr startatguiguhadoop104 solr$ bin/solr start6)进入/opt/module/atlas路径,重新启动Atlas服务atguiguhadoop102 atlas$ bin/atlas_stop.pyatguiguhadoop102 atlas$ bin/atlas_start.py提示:错误信息查看路径:/opt/module/atlas/logs/*.out和application.log访问地址:http:/hadoop102:21000注意:等待时间大概2分钟。账户:admin密码:admin2.4 将Hive元数据导入Atlas1)配置Hive环境变量atguiguhadoop102 hive$ sudo vim /etc/profile#配置Hive环境变量export HIVE_HOME=/opt/module/hiveexport PATH=$PATH:$HIVE_HOME/bin/atguiguhadoop102 hive$ source /etc/profile2)启动Hive,如果Hive能正常启动说明环境OK,就可以退出Hive客户端atguiguhadoop102 hive$ hive hive (default) show databases;hive (default) use gmall;3)在/opt/module/atlas/路径,将Hive元数据导入到Atlasatguiguhadoop102 atlas$ bin/import-hive.shUsing Hive configuration directory /opt/module/hive/confLog file for import is /opt/module/atlas/logs/import-hive.loglog4j:WARN No such property maxFileSize in org.apache.log4j.PatternLayout.log4j:WARN No such property maxBackupIndex in org.apache.log4j.PatternLayout.输入用户名:admin;输入密码:adminEnter username for atlas :- adminEnter password for atlas :- Hive Meta Data import was successful!2.5 Atlas常用配置(可选)2.5.1 配置内存如果计划存储数万个元数据对象,建议调整参数值获得最佳的JVM GC性能。以下是常见的服务器端选项1)修改配置文件/opt/module/atlas/conf/atlas-env.sh#设置Atlas内存export ATLAS_SERVER_OPTS=-server -XX:SoftRefLRUPolicyMSPerMB=0 -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+PrintTenuringDistribution -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=dumps/atlas_server.hprof -Xloggc:logs/gc-worker.log -verbose:gc -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=1m -XX:+PrintGCDetails -XX:+PrintHeapAtGC -XX:+PrintGCTimeStamps#建议JDK1.7使用以下配置export ATLAS_SERVER_HEAP=-Xms15360m -Xmx15360m -XX:MaxNewSize=3072m -XX:PermSize=100M -XX:MaxPermSize=512m#建议JDK1.8使用以下配置export ATLAS_SERVER_HEAP=-Xms15360m -Xmx15360m -XX:MaxNewSize=5120m -XX:MetaspaceSize=100M -XX:MaxMetaspaceSize=512m#如果是Mac OS用户需要配置export ATLAS_SERVER_OPTS=-Djava.awt.headless=true -Djava.security.krb5.realm= -Djava.security.krb5.kdc=参数说明:-XX:SoftRefLRUPolicyMSPerMB 此参数对管理具有许多并发用户的查询繁重工作负载的GC性能特别有用。2.5.2 配置用户名密码 Atlas支持以下身份验证方法:File、Kerberos协议、LDAP协议通过修改配置文件perties文件开启或关闭三种验证方法atlas.authentication.method.kerberos=true|falseatlas.authentication.method.ldap=true|falseatlas.authentication.method.file=true|false如果两个或多个身份证验证方法设置为true,如果较早的方法失败,则身份验证将回退到后一种方法。例如,如果Kerberos身份验证设置为true并且ldap身份验证也设置为true,那么,如果对于没有kerberos principal和keytab的请求,LDAP身份验证将作为后备方案。本文主要讲解采用文件方式修改用户名和密码设置。其他方式可以参见官网配置即可。1)打开/opt/module/atlas/conf/perties文件atguiguhadoop102 conf$ vim perties#username=group:sha256-passwordadmin=ADMIN:8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918rangertagsync=RANGER_TAG_SYNC:e3f67240f5117d1753c940dae9eea772d36ed5fe9bd9c94a300e40413f1afb9d(1)admin是用户名称(2)8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918是采用sha256加密的密码,默认密码为admin。2)例如:修改用户名称为atguigu,密码为atguigu(1)获取sha256加密的atguigu密码atguiguhadoop102 conf$ echo -n atguigu|sha256sum2628be627712c3555d65e0e5f9101dbdd403626e6646b72fdf728a20c5261dc2(2)修改用户名和密码atguiguhadoop102 conf$ vim perties#username=group:sha256-passwordatguigu=ADMIN:2628be627712c3555d65e0e5f9101dbdd403626e6646b72fdf728a20c5261dc2rangertagsync=RANGER_TAG_SYNC:e3f67240f5117d1753c940dae9eea772d36ed5fe9bd9c94a300e40413f1afb9d第3章 界面查看3.1 基本信息查看3.1.1 登录1)访问http:/hadoop102:21000端口号 进行登录2)账号密码默认都为admin,登录成功页面如下3.1.2 查询Hive库1)查询相应的Hive库,类型选择hive_db3.1.3 查询Hive进程查询Hive进程,类型选择hive_process3.1.4 查询Hive表查询Hive表,类型选择hive_table3.1.5 查询Hive列查询Hive表,类型选择hive_column3.1.6 筛选查询条件比如要查询name为sequence的列,那么在Search By Query 填写 where name=sequence 其他选项筛选条件写法一样。3.1.7 查看具有血缘依赖列的数据查询类型选择hive_column_lineage3.2 查看血缘依赖关系3.2.1 第一次查看表血缘依赖1)先选中hive_db,点击hive_db查看对应的表,如下图选中gmall库查看相应的表。2)点击Tables按钮,可以看到gmall数据库中的所有表。3)点击Properties,查看到表详情4)点击Lineage,显示血缘依赖关系5)点击Audits,显示表修改过几次对应的时间和详情6)点击Schema,可以查看到表字段信息3.2.2 第一次查看字段血缘依赖1)点击gmv_count字段2)点击Properties,显示字段详情3)点击Lineage,显示血缘关系4)点击Audits,显示修改时间和详情3.2.3 启动GMV全流程任务1)启动Azkaban(1)启动executor服务器。在executor服务器目录下执行启动命令atguiguhadoop102 executor$ pwd/opt/module/azkaban/executoratguiguhadoop102 executor$ bin/azkaban-executor-start.sh(2)启动web服务器。在azkaban web服务器目录下执行启动命令atguiguhadoop102 server$ pwd/opt/module/azkaban/serveratguiguhadoop102 server$ bin/azkaban-web-start.sh(3)查看web页面:https:/hadoop102:8443/2)上传任务参见数仓项目中,Azkaban任务提交流程。3)查看结果等待Azkaban运行结束。4)查看Atlas表血缘依赖关系图5)查看Atlas字段血缘依赖关系图3.3 Rest API使用(二次开发使用)如果需要对Atlas进行二次开发,可以查看官网地址,/api/v2/index.html,根据官方API进行二次开发。第4章 编译Atlas源码4.1.1 安装Maven1)Maven下载:/download.cgi2)把apache-maven-3.6.1-bin.tar.gz上传到linux的/opt/software目录下3)解压apache-maven-3.6.1-bin.tar.gz到/opt/module/目录下面atguiguhadoop102 software$ tar -zxvf apache-maven-3.6.1-bin.tar.gz -C /opt/modul
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 魔术剪辑基础知识培训课件
- 济南市2024-2025学年八年级下学期语文期末模拟试卷
- 电路故障诊断与处理
- 电赛知识培训课件
- 电脑公司基本知识培训课件
- rgp考试题及答案
- pfmea考试题及答案
- 电缆绞磨机课件
- 高空培训课件
- HET0016-Standard-生命科学试剂-MCE
- 装配工基本技能培训
- 2020输变电工程通用设计35~110kV输电线路站分册
- 软件管理系统产品报价单模板(详细)
- 焊工施工方案大全
- 教学设备安装调试方案投标方案
- 中建350吨履带吊安装、拆除安全专项方案
- 医院诊断证明书word模板
- 汕头市房地产租赁合同
- 药物制剂技术专业
- 小学生课堂常规课件
- 人教版六年级语文上册说教材课件
评论
0/150
提交评论