Note31:Apache Atlas-0.8.4 安装配置

源码包下载

  • 地址:
  • 个人选择这个版本 apache-atlas-0.8.4-sources.tar.gz
  • 源码包 上传到 /opt/software 目录

编译

  • 环境:Maven-3.6.3
  • 编译(编译时间主要看下载相关jar包的速度)
[kevin@hadoop112 software]$ tar -zxvf apache-atlas-0.8.4-sources.tar.gz
[kevin@hadoop112 software]$ cd apache-atlas-sources-0.8.4/
[kevin@hadoop112 software]$ export MAVEN_OPTS="-Xms2g -Xmx2g"
[kevin@hadoop112 software]$ mvn clean -DskipTests install
  • Build将创建以下文件,这些文件用于安装Apache Atlas。
distro/target/apache-atlas-0.8.4-bin.tar.gz
distro/target/apache-atlas-0.8.4-hbase-hook.tar.gz
distro/target/apache-atlas-0.8.4-hive-hook.gz
distro/target/apache-atlas-0.8.4-kafka-hook.gz
distro/target/apache-atlas-0.8.4-sources.tar.gz
distro/target/apache-atlas-0.8.4-sqoop-hook.tar.gz
distro/target/apache-atlas-0.8.4-storm-hook.tar.gz

环境准备

  • JDK-8
  • Hadoop-2.7.2
  • Zookeeper-3.4.10
  • Kafka-0.11.0.0
  • Hbase-1.3.6
  • Hive-2.3.6
  • Azkaban-2..5.0

如果采用的 Hive2.3.6 版本,Azkaban 需要在启动脚本中将 hive 的环境变量注释掉。(没测试过)

  • Solr5.2.1

  • 解压编译好的 apache-atlas-0.8.4-bin.tar.gz

[kevin@hadoop112 software]$ tar -zxvf apache-atlas-0.8.4-bin.tar.gz -C /opt/module
  • 改名
[kevin@hadoop112 software]$ cd /opt/module
[kevin@hadoop112 module]$ mv apache-atlas-0.8.4/ atlas-0.8.4

Atlas 集成外部框架

1、Atlas 集成 Hbase
  • 修改 atlas-application.properties 配置文件
[kevin@hadoop112 module]$ cd atlas-0.8.4/conf/
[kevin@hadoop112 conf]$ vim atlas-application.properties

# 修改 atlas 存储数据主机
atlas.graph.storage.hostname=hadoop112:2181,hadoop113:2181,hadoop114:2181
  • 进入到 /opt/module/atlas-0.8.4/conf/hbase 路径,添加 Hbase 集群的配置文件到${Atlas_Home}
[kevin@hadoop112 conf]$ /opt/module/atlas-0.8.4/conf/hbase
[kevin@hadoop112 hbase]$ ln -s /opt/module/hbase-1.3.6/conf/ /opt/module/atlas-0.8.4/conf/hbase
  • 在 /opt/module/atlas/conf/atlas-env.sh 中添加 HBASE_CONF_DIR
[kevin@hadoop112 conf]$ vim atlas-env.sh

#添加 HBase 配置文件路径
export HBASE_CONF_DIR=/opt/module/atlas-0.8.4/conf/hbase/conf
2、Atlas 集成 Solr
  • 进入/opt/module/atlas-0.8.4/conf 目录,修改配置文件
[kevin@hadoop112 conf]$ vim atlas-application.properties

#修改如下配置
atlas.graph.index.search.solr.zookeeper-url=hadoop112:2181,hadoop113:2181,hadoop114:2181
  • 将 Atlas 自带的 Solr 文件夹拷贝到外部 Solr 集群的各个节点
[kevin@hadoop112 conf]$ cp -r /opt/module/atlas-0.8.4/conf/solr /opt/module/solr-5.2.1/
  • 进入到/opt/module/solr-5.2.1路径,修改拷贝过来的配置文件名称为 atlas_conf
[kevin@hadoop112 solr-5.2.1]$ mv solr atlas_conf
  • 在 Cloud 模式下,启动 Solr(需要提前启动 Zookeeper 集群),并创建 collection
[kevin@hadoop112 solr-5.2.1]$ bin/solr create -c vertex_index -d /opt/module/solr-5.2.1/atlas_conf -shards 3 -replicationFactor 2
[kevin@hadoop112 solr-5.2.1]$ bin/solr create -c edge_index -d /opt/module/solr-5.2.1/atlas_conf -shards 3 -replicationFactor 2
[kevin@hadoop112 solr-5.2.1]$ bin/solr create -c fulltext_index -d /opt/module/solr-5.2.1/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 可以执行如 下命令。

[kevin@hadoop112 solr-5.2.1]$ bin/solr delete -c ${collection_name}
  • 验证创建 collection 成功

登录 solr web 控制台:http://hadoop112:8983/solr/#/~cloud 看到如下图显示

3、Atlas 集成 Kafka
  • 进入/opt/module/atlas-0.8.4/conf/目录,修改配置文件 atlas-application.properties
[kevin@hadoop112 conf]$ /opt/module/atlas-0.8.4/conf/
[kevin@hadoop112 conf]$ vim atlas-application.properties

######### Notification Configs #########
atlas.notification.embedded=false
atlas.kafka.zookeeper.connect=hadoop112:2181,hadoop113:2181,hadoop114:2181
atlas.kafka.bootstrap.servers=hadoop112:9092,hadoop113:9092,hadoop114:9092
atlas.kafka.zookeeper.session.timeout.ms=4000
atlas.kafka.zookeeper.connection.timeout.ms=2000

atlas.kafka.enable.auto.commit=true
  • 启动 Kafka 集群,并创建 Topic
[kevin@hadoop112 kafka]$ bin/kafka-topics.sh --zookeeper hadoop112:2181,hadoop113:2181,hadoop114:2181 --create --replication-factor 3 --partitions 3 --topic _HOATLASOK
[kevin@hadoop112 kafka]$ bin/kafka-topics.sh --zookeeper hadoop112:2181,hadoop113:2181,hadoop114:2181 --create --replication-factor 3 --partitions 3 --topic ATLAS_ENTITIES
4、Atlas 其他配置
  • 进入/opt/module/atlas-0.8.4/conf/目录,修改配置文件 atlas-application.properties
[kevin@hadoop112 conf]$ vim atlas-application.properties

######### Server Properties #########
atlas.rest.address=http://hadoop112:21000
# If enabled and set to true, this will run setup steps when the server starts
atlas.server.run.setup.on.start=false

######### Entity Audit Configs #########
atlas.audit.hbase.zookeeper.quorum=hadoop112:2181,hadoop113:2181,hadoop114:2181
  • 记录性能指标,进入/opt/module/atlas-0.8.4/conf/路径,修改当前目录下的 atlas-log4j.xml
[kevin@hadoop112 conf]$ vim atlas-log4j.xml

#去掉如下代码的注释

    
    
    
    
        
    



    
    

5、Atlas 集成 Hive
  • 进入/opt/module/atlas-0.8.4/conf/目录,修改配置文件 atlas-application.properties
[kevin@hadoop112 conf]$ vim atlas-application.properties

######### Hive Hook Configs #######
atlas.hook.hive.synchronous=false
atlas.hook.hive.numRetries=3
atlas.hook.hive.queueSize=10000
atlas.cluster.name=primary
  • 将 atlas-application.properties 配置文件加入到 atlas-plugin-classloader-1.0.0.jar 中
[kevin@hadoop112 conf]$ zip -u /opt/module/atlas-0.8.4/hook/hive/atlas-plugin-classloader-0.8.4.jar /opt/module/atlas-0.8.4/conf/atlas-application.properties
[kevin@hadoop112 conf]$ cp /opt/module/atlas-0.8.4/conf/atlas-application.properties /opt/module/hive-2.3.6/conf/

原因:这个配置不能参照官网,将配置文件考到 hive 的 conf 中。参考官网的做法一直读取不到 atlas-application.properties 配置文件,看了源码发现是在 classpath 读取的这个 配置文件,所以将它压到 jar 里面。

  • 在/opt/module/hive-2.3.6/conf/hive-site.xml 文件中设置 Atlas hook
[kevin@hadoop112 conf]$ cd /opt/module/hive-2.3.6/conf/
[kevin@hadoop112 conf]$ vim hive-site.xml


   hive.exec.post.hooks
   org.apache.atlas.hive.hook.HiveHook

  • 在/opt/module/hive-2.3.6/conf/hive-env.sh 文件 配置hive 插件相关 jar 包
[kevin@hadoop112 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-0.8.4/hook/hive/atlas-plugin-classloader-0.8.4.jar,/opt/module/atlas-0.8.4/hook/hive/hive-bridge-shim-0.8.4.jar

集群启动

  • 启动 Hadoop 集群
[kevin@hadoop112 module]$ hadoop-cluster.sh start
  • 启动 Zookeeper 集群
[kevin@hadoop112 module]$ zk.sh start
  • 启动 Kafka 集群
[kevin@hadoop112 module]$ kfk.sh start
  • 启动 Hbase 集群:
[kevin@hadoop112 module]$ cd hbase-1.3.6
[kevin@hadoop112 hbase-1.3.6]$ bin/start-hbase.sh
  • 启动 Solr 集群
[kevin@hadoop112 module]$ solr-cluster.sh start
  • 进入/opt/module/路径,重新启动 Atlas 服务
[atguigu@hadoop102 atlas-0.8.4]$ bin/atlas_stop.py

[atguigu@hadoop102 atlas-0.8.4]$ bin/atlas_start.py

日志文件路径:提示:错误信息查看路径:/opt/module/atlas/logs/*.out 和 application.log

访问地址:http://hadoop112:21000

注意:等待时间大概 2 分钟。

账户:admin

密码:admin

你可能感兴趣的:(Note31:Apache Atlas-0.8.4 安装配置)