Atlas如何集成HIve

這篇文章主要為大家展示了“Atlas如何集成HIve”,內(nèi)容簡(jiǎn)而易懂,條理清晰,希望能夠幫助大家解決疑惑,下面讓小編帶領(lǐng)大家一起研究并學(xué)習(xí)一下“Atlas如何集成HIve”這篇文章吧。

網(wǎng)站建設(shè)哪家好,找創(chuàng)新互聯(lián)公司!專(zhuān)注于網(wǎng)頁(yè)設(shè)計(jì)、網(wǎng)站建設(shè)、微信開(kāi)發(fā)、微信平臺(tái)小程序開(kāi)發(fā)、集團(tuán)企業(yè)網(wǎng)站建設(shè)等服務(wù)項(xiàng)目。為回饋新老客戶(hù)創(chuàng)新互聯(lián)還提供了珠海免費(fèi)建站歡迎大家使用!

 

Atlas集成Hive

在安裝好Atlas以后,如果想要使用起來(lái),還要讓Atlas與其他組件建立聯(lián)系。

其中最常用的就是Hive。

Atlas如何集成HIve

通過(guò)Atlas的架構(gòu),只要配置好Hive Hook ,那么每次Hive做任何操作就會(huì)寫(xiě)入Kafka從而被atlas接收。

并在Atlas中已圖的形式展示出來(lái)。

 

Hive Model

都會(huì)記錄Hive哪些操作信息呢?Altas對(duì)Hive Model進(jìn)行了定義。

包含以下內(nèi)容:

 
1、實(shí)體類(lèi)型:
 
hive_db

類(lèi)型:Asset

屬性:qualifiedName, name, description, owner, clusterName, location, parameters, ownerName

 
hive_table

類(lèi)型:DataSet

屬性:qualifiedName, name, description, owner, db, createTime, lastAccessTime, comment, retention, sd, partitionKeys, columns, aliases, parameters, viewOriginalText, viewExpandedText, tableType, temporary

hive_column

類(lèi)型:DataSet

屬性:qualifiedName, name, description, owner, type, comment, table

hive_storagedesc

類(lèi)型:Referenceable

屬性:qualifiedName, table, location, inputFormat, outputFormat, compressed, numBuckets, serdeInfo, bucketCols, sortCols, parameters, storedAsSubDirectories

hive_process

類(lèi)型:Process

屬性:qualifiedName, name, description, owner, inputs, outputs, startTime, endTime, userName, operationType, queryText, queryPlan, queryId, clusterName

hive_column_lineage

類(lèi)型:Process

屬性:qualifiedName, name, description, owner, inputs, outputs, query, depenendencyType, expression

 
2、枚舉類(lèi)型:

hive_principal_type 值:USER, ROLE, GROUP

 
3、構(gòu)造類(lèi)型

hive_order 屬性:col, order

hive_serde 屬性:name, serializationLib, parameters

HIve實(shí)體的結(jié)構(gòu):

hive_db.qualifiedName:     <dbName>@<clusterName>
hive_table.qualifiedName:  <dbName>.<tableName>@<clusterName>
hive_column.qualifiedName: <dbName>.<tableName>.<columnName>@<clusterName>
hive_process.queryString:  trimmed query string in lower case
   

配置Hive hook

hive hook會(huì)監(jiān)聽(tīng)hive的 create/update/delete 操作,下面是配置步驟:

1、修改hive-env.sh(指定包地址)

export HIVE_AUX_JARS_PATH=/opt/apps/apache-atlas-2.1.0/hook/hive
 

2、修改hive-site.xml(配置完需要重啟hive)

<property>
   <name>hive.exec.post.hooks</name>
   <value>org.apache.atlas.hive.hook.HiveHook</value>
</property>
1234
 

注意,這里其實(shí)是執(zhí)行后的監(jiān)控,可以有執(zhí)行前,執(zhí)行中的監(jiān)控。

3、同步配置 拷貝atlas配置文件atlas-application.properties到hive配置目錄 添加配置:

atlas.hook.hive.synchronous=false
atlas.hook.hive.numRetries=3
atlas.hook.hive.queueSize=10000
atlas.cluster.name=primary
atlas.rest.address=http://doit33:21000
   

將Hive元數(shù)據(jù)導(dǎo)入Atlas

bin/import-hive.sh

Using Hive configuration directory [/opt/module/hive/conf]

Log file for import is /opt/module/atlas/logs/import-hive.log

log4j:WARN No such property [maxFileSize] in org.apache.log4j.PatternLayout.

log4j:WARN No such property [maxBackupIndex] in org.apache.log4j.PatternLayout.

輸入用戶(hù)名:admin;輸入密碼:admin

Enter username for atlas :- admin

Enter password for atlas :-

Hive Meta Data import was successful!!!

 

踩坑全記錄

 
一、找不到類(lèi) org.apache.atlas.hive.hook.hivehook

hive第三方j(luò)ar包沒(méi)加進(jìn)去

小技巧 使用hive-shell 看一下jar包加進(jìn)去沒(méi)有 set這將打印由用戶(hù)或配置單元覆蓋的配置變量列表。

以加入elsaticsearch-hadoop-2.1.2.jar為例,講述在Hive中加入第三方j(luò)ar的幾種方式。

1,在hive shell中加入

hive> add jar /home/hadoop/elasticsearch-hadoop-hive-2.1.2.jar;

連接方式是否有效
Hive Shell不需要重啟Hive服務(wù)就有效
Hive Server無(wú)效

2,Jar放入${HIVE_HOME}/auxlib目錄

在${HIVE_HOME}中創(chuàng)建文件夾auxlib,然后將自定義jar文件放入該文件夾中。此方法添加不需要重啟Hive。而且比較便捷。

連接方式是否有效
Hive Shell不需要重啟Hive服務(wù)就有效
Hive Server重啟Hive服務(wù)才生效

3,HIVE.AUX.JARS.PATH和hive.aux.jars.path

hive-env.sh中的HIVE.AUX.JARS.PATH和hive-site.xml的hive.aux.jars.path配置對(duì)服務(wù)器無(wú)效,僅對(duì)當(dāng)前hive shell有效,不同的hive shell相互不影響,每個(gè)hive shell都需要配置,可以配置成文件夾形式。HIVE.AUX.JARS.PATH和hive.aux.jars.path僅支持本地文件。可配置成文件,也可配置為文件夾。

連接方式是否有效
Hive Shell重啟Hive服務(wù)才生效
Hive Server重啟Hive服務(wù)才生效
 
二、HIVE報(bào)錯(cuò) Failing because I am unlikely to write too

HIVE.AUX.JARS.PATH配置不對(duì)

hive-env.sh腳本中有一段

# Folder containing extra libraries required for hive compilation/execution can be controlled by:
if [ "${HIVE_AUX_JARS_PATH}" != "" ]; then
 export HIVE_AUX_JARS_PATH=${HIVE_AUX_JARS_PATH}
elif [ -d "/usr/hdp/current/hive-webhcat/share/hcatalog" ]; then
 export HIVE_AUX_JARS_PATH=/usr/hdp/current/hive-webhcat/share/hcatalog
fi
 

如果給HIVE_AUX_JARS_PATH設(shè)值,則/usr/hdp/current/hive-webhcat/share/hcatalog就會(huì)被忽略掉。

hive只能讀取一個(gè)HIVE_AUX_JARS_PATH

在一個(gè)地方集中放置我們的共享jar包,然后在/usr/hdp/current/hive-webhcat/share/hcatalog下面建立一相應(yīng)的軟連接就可以

sudo -u hive ln -s /usr/lib/share-lib/elasticsearch-hadoop-2.1.0.Beta4.jar /usr/hdp/current/hive-webhcat/share/hcatalog/elasticsearch-hadoop-2.1.0.Beta4.jar

以上是“Atlas如何集成HIve”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對(duì)大家有所幫助,如果還想學(xué)習(xí)更多知識(shí),歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道!

當(dāng)前名稱(chēng):Atlas如何集成HIve
轉(zhuǎn)載源于:http://muchs.cn/article38/jopopp.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供品牌網(wǎng)站設(shè)計(jì)網(wǎng)站排名、虛擬主機(jī)、做網(wǎng)站、關(guān)鍵詞優(yōu)化、企業(yè)網(wǎng)站制作

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

外貿(mào)網(wǎng)站建設(shè)