在文章元数据管理工具Atlas学习笔记之介绍中,我介绍了Atlas这一元数据管理工具,现在,就要将它进行编译,并且和一些常见的大数据组件进行集成。
操作系统:CentOS7,64位虚拟机,VMware WorkStation虚拟机管理器;
软件及其版本和位置:
软件名称 | 版本 |
---|---|
maven | 3.6.0(必须是3.5.0及以上,否则无法编译atlas) |
Hadoop | 2.7.2 |
ZooKeeper | 3.4.9 |
Kafka | kafka_2.11-0.11.0.0,scala2.11,kafka0.11.0.0 |
HBase | 1.3.1 |
Hive | 2.3.7 |
MySQL | 5.7.26 |
solr | 7.7.3 |
Atlas | 1.2.0 |
Maven~MySQL的安装配置此处略过,自行搜索,此处记录solr和Atlas的安装配置过程。
可执行文件下载地址:https://www.apache.org/dyn/closer.lua/lucene/solr/7.7.3/solr-7.7.3.tgz?action=download
解压:
[root@scentos szc]# tar -zxvf solr-7.7.3.tgz
solr不能以root身份执行,因此类似ES,需要为其创建用户、设置密码(solr),并把solr根目录的所属者改为该用户
root@scentos szc]# useradd solr
[root@scentos szc]# passwd solr
Changing password for user solr.
New password:
BAD PASSWORD: The password is shorter than 8 characters
Retype new password:
passwd: all authentication tokens updated successfully.
[root@scentos szc]# chown -R solr:solr solr-7.7.3/
用solr用户身份进入solr根目录,修改配置文件bin/solr.in.sh:
[root@scentos szc]# su solr
[solr@scentos szc]$ cd solr-7.7.3/
[solr@scentos solr-7.7.3]$ vim bin/solr.in.sh
将ZK_HOST所在行取消注释,并改为自己ZooKeeper的ip:端口:
ZK_HOST="scentos:2181"
下载地址: https://dlcdn.apache.org/atlas/1.2.0/apache-atlas-1.2.0-sources.tar.gz
解压、编译:
[root@scentos szc]# tar -zxvf apache-atlas-1.2.0-sources.tar.gz
[root@scentos szc]# mv apache-atlas-sources-1.2.0/ atlas-1.2.0/
[root@scentos szc]# cd atlas-1.2.0/
[root@scentos atlas-1.2.0]# export MAVEN_OPTS="-Xms2g -Xmx2g"
[root@scentos atlas-1.2.0]# mvn clean -DskipTests install && mvn clean -DskipTests package -Pdist
编译结果:
进入distro/target/apache-atlas-1.2.0-server/apache-atlas-1.2.0目录,这就是我们atlas-server的根目录。
分享一下启动脚本:
start-all.sh
mr-jobhistory-daemon.sh start historyserver
httpfs.sh start
/home/szc/zookeeper/zookeeper-3.4.9/bin/zkServer.sh start
/home/szc/hbase-1.3.1/bin/start-hbase.sh
/home/szc/kafka_2.11-0.11.0.0/bin/kafka-server-start.sh -daemon /home/szc/kafka_2.11-0.11.0.0/config/server.properties
Windows下通过打开Navicat启动,先执行一下设置时区的SQL脚本:
set global time_zone='+8:00';
/home/szc/apache-hive-2.3.7/bin/hive --service metastore &
用solr用户身份启动solr:
[solr@scentos solr-7.7.3]$ bin/solr start
在windows下访问IP:8983,可以看到如下web界面:
进入atlas-server根目录:
[root@scentos atlas-1.2.0]# cd distro/target/apache-atlas-1.2.0-server/apache-atlas-1.2.0/
[root@scentos apache-atlas-1.2.0]#
在conf/atlas-application.properties中,将atlas.graph.storage.backend从hbase2改成hbase、atlas.graph.storage.hostname赋值为ZooKeeper的URL:
atlas.graph.storage.backend=hbase
....
atlas.graph.storage.hostname=scentos:2181
在conf/atlas-env.sh中加上HBase的配置目录:
export HBASE_CONF_DIR=/home/szc/hbase-1.3.1/conf
在conf/atlas-application.properties中,将atlas.graph.index.search.solr.zookeeper-url赋值为ZooKeeper的URL:
atlas.graph.index.search.solr.zookeeper-url=scentos:2181
到Solr根目录中,以用户solr身份执行以下命令,创建solr数据集:
[solr@scentos solr-7.7.3]$ bin/solr create -c vertex_index -d /home/szc/atlas-1.2.0/distro/target/apache-atlas-1.2.0-server/apache-atlas-1.2.0/conf/solr/ -shards 3 -replicationFactor 2
Created collection 'vertex_index' with 3 shard(s), 2 replica(s) with config-set 'vertex_index'
[solr@scentos solr-7.7.3]$ bin/solr create -c edge_index -d /home/szc/atlas-1.2.0/distro/target/apache-atlas-1.2.0-server/apache-atlas-1.2.0/conf/solr/ -shards 3 -replicationFactor 2
Created collection 'edge_index' with 3 shard(s), 2 replica(s) with config-set 'edge_index'
[solr@scentos solr-7.7.3]$ bin/solr create -c fulltext_index -d /home/szc/atlas-1.2.0/distro/target/apache-atlas-1.2.0-server/apache-atlas-1.2.0/conf/solr/ -shards 3 -replicationFactor 2
Created collection 'fulltext_index' with 3 shard(s), 2 replica(s) with config-set 'fulltext_index'
[solr@scentos solr-7.7.3]$
上面三条命令除了vertex_index、edge_index和fulltext_index外,一模一样,-d参数值要改成自己atlas根目录下conf/solr目录路径
在conf/atlas-application.properties中,修改以下属性值:
120 ######### Notification Configs #########
atlas.notification.embedded=false # 不使用atlas内置的kafka
atlas.kafka.data=/home/szc/kafka_2.11-0.11.0.0/data # kafka的数据存储目录
atlas.kafka.zookeeper.connect=scentos:2181 # ZooKeeper的URL
atlas.kafka.bootstrap.servers=scentos:9092 # kafka服务器的URL
kafka的数据存储目录和kafka服务器URL参见kafka的配置文件:kafkaHome/config/server.properties,分别对应log.dirs和listeners属性值
在conf/atlas-application.properties中,修改以下属性值:
## Server port configuration
atlas.server.http.port=21000 # 注释打开
....
atlas.rest.address=http://scentos:21000 # scentos改成自己CentOS的IP或域名
# 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=scentos:2181 # scentos改成自己CentOS的IP或域名,此处为ZooKeeper的URL
在conf/atlas-log4j.xml中,打开下面代码的注释,以记录性能指标:
<appender name="perf_appender" class="org.apache.log4j.DailyRollingFileAppender">
<param name="file" value="${atlas.log.dir}/atlas_perf.log" />
<param name="datePattern" value="'.'yyyy-MM-dd" />
<param name="append" value="true" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d|%t|%m%n" />
</layout>
</appender>
<logger name="org.apache.atlas.perf" additivity="false">
<level value="debug" />
<appender-ref ref="perf_appender" />
</logger>
在conf/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
到Hive根目录下,在conf/hive-site.xml中加入以下属性:
<property>
<name>hive.exec.post.hooks</name>
<value>org.apache.atlas.hive.hook.HiveHook</value>
</property>
并在conf/hive-env.sh文件最后加上下面几行:
export ATLAS_HIVE_HOOK_JARS=""
export ATLAS_HIVE_HOOK_HOME=/home/szc/apache-atlas-sources-1.2.0/distro/target/apache-atlas-1.2.0-hive-hook/apache-atlas-hive-hook-1.2.0/hook/hive
for jar in `ls $ATLAS_HIVE_HOOK_HOME | grep jar`; do
export ATLAS_HIVE_HOOK_JARS=$ATLAS_HIVE_HOOK_JARS:$ATLAS_HIVE_HOOK_HOME/$jar
done
for jar in `ls $ATLAS_HIVE_HOOK_HOME/atlas-hive-plugin-impl`; do
export ATLAS_HIVE_HOOK_JARS=$ATLAS_HIVE_HOOK_JARS:$ATLAS_HIVE_HOOK_HOME/atlas-hive-plugin-impl/$jar
done
export HIVE_AUX_JARS_PATH=$HIVE_AUX_JARS_PATH$ATLAS_HIVE_HOOK_JARS
最后,回到atlas-server根目录,把atlas的atlas-application.properties文件复制到HiveHome/conf中
[root@scentos apache-atlas-1.2.0]# cp conf/atlas-application.properties /home/szc/apache-hive-2.3.7/conf/
下载以下三个文件:
文件名 | 下载链接 |
---|---|
jackson-module-jaxb-annotations-2.9.9.jar | https://repo1.maven.org/maven2/com/fasterxml/jackson/module/jackson-module-jaxb-annotations/2.9.9/jackson-module-jaxb-annotations-2.9.9.jar |
jackson-jaxrs-base-2.9.9.jar | https://repo1.maven.org/maven2/com/fasterxml/jackson/jaxrs/jackson-jaxrs-base/2.9.9/jackson-jaxrs-base-2.9.9.jar |
jackson-jaxrs-json-provider-2.9.9.jar | https://repo1.maven.org/maven2/com/fasterxml/jackson/jaxrs/jackson-jaxrs-json-provider/2.9.9/jackson-jaxrs-json-provider-2.9.9.jar |
将这三个jar包,上传到/home/szc/atlas-1.2.0/distro/target/apache-atlas-1.2.0-hive-hook/apache-atlas-hive-hook-1.2.0/hook/hive/atlas-hive-plugin-impl/目录下,然后重启hive,执行以下脚本文件即可:
pid=`ps -ef | grep hive.metastore | grep -v grep | awk '{print $2}'`
kill ${pid}
/home/szc/apache-hive-2.3.7/bin/hive --service metastore &
在atlas-server根目录下,执行文件:
[root@scentos apache-atlas-1.2.0]# bin/atlas_start.py
等待一两分钟,见到如下结果就说明启动成功:
而后在浏览器里访问CentOS_ip:21000,会出现以下界面:
默认用户名密码都是admin,出现以下界面,则atlas配置并启动成功。
如果出现问题,可通过atlas-server根目录/logs/*.out或application.log查看报错信息。
下一篇文章,我以Hive为例,介绍Atlas网页端的操作方法。
养成编程开发的好习惯,做一名优秀的程序员 编程规范1 >public方法参数的合法性检查应由方法本身负责,每一个public方法必须保证自己的健壮性。错误示例: public String getDate(Date date) { //缺少入参检查 SimpleDateFormat sf = new SimpleDateFormat("yyy...
1,使用AVPro Movie Capture插件2,自带的简单案例_unity avp_photostudio
第25章 SNMP: 简单网络管理协议25.12 SNMPv2在1 9 9 3年,发表了定义新版本S N M P的11个R F C。RFC 1441 [Case et al. 1993]是其中的第一个,它系统地介绍了S N M P v 2。同样,有两本书 [Stallings 1993; Rose 1994]也对S N M P v 2进行了介绍。现在已经有两个 S N M P v 2的基本模型...
PHP操作MySQL必须先开启mysq扩展函数库 首先先开启extension = mysqli_dll; 开启成功呢我就可以开始连接数据库了, 第一步:连接数据库 mysqli_connect(服务器地址,mysql用户名,mysql密码); $link= @mysqli_connect('localhost','root','123456');
实现一个凯撒密码的变种算法,对输入字符串进行加解密处理 把字母a-z分别循环对应为相距13个位置的字母n-m,即 原文字母:a b c d e f g h i j k l m n o p q r s t u v w x y z 对应字母:n o p q r s t u v w x y z a b c d e f g h i j k l m 大写字母对应方式与小写字母类似,其他符号(含标点符号
第一行代码加上 { raw: true } 导出的时候使用原来的格式var wb = XLSX.utils.table_to_book(document.querySelector("#out-table"),{ raw: true })对数据进行处理,给导出的数据加" ` “或者” \t "
刚接触idea,在一个project中创建了好几个module。之前使用eclipse,所以就把之前的文件都直接copy到idea中,然后在idea中运行Tomcat进行浏览。刚开始创建module后,运行预览都正常。但是当我copy项目文件到idea后,再预览,就出现404错误。文件路径、代码转向什么都是正确的。在没copy项目文件进入idea之前,预览正常。拷贝完文件到id...
在一个以上的地方看到了相同的代码结构,则视为重复代码同一个类的两个方法含有相同的表达式使用 6.1 Extract Method 提炼方法 提炼出重复的代码,放置到新方法中让两个方法都调用该新方法两个继承相同父类的子类含有相同的表达式EX1对两个子类都使用 6.1 Extract Method 提炼方法 提炼出重复的代码,放置到新方法中对新方法使用 11.2 Pull U...
hadoop3.x把50070的默认端口修改为9870_hadoop 3.x 50070
【●】Prometheus监控服务器1.监控简介●Prometheus是由SoundCloud开源的监控报警解决方案。— 采用Go语言开发— Prometheus存储的是时序数据(时序数据库)— 数据带时间标签— 如<metric name> {< | abe | name>=<|abe| value>, . . .}— Prometheus主要用在监控容器数据,也可以监控常规主机— Prometheus重视高利用,如果您需要100%准确性、那么该软件不适
React中Suspense及lazy()懒加载原理和使用的理解Suspense和lazy()都是react中比较新的特性,在项目中使用还比较少,但是学习一下有助于在后面的项目中使用,同样可以一窥React未来的发展方向React.lazy()概括顾名思义lazy()方法是用来对项目代码进行分割,懒加载用的.只有当组件被加载,内部的资源才会导入为什么需要懒加载在React的项目中i..._suspence与lazy
一、项目背景【项目简介】Azure Machine Learning(简称“AML”)是微软在其公有云Azure上推出的基于Web使用的一项机器学习服务,机器学习属人工智能的一个分支,它技术借助算法让电脑对大量流动数据集进行识别。这种方式能够通过历史数据来预测未来事件和行为,其实现方式明显优于传统的商业智能形式。微软的目标是简化使用机器学习的过程,以便于开发人员、业务分析师和数据科学家进行..._机器学习窗体实例