Presto分布式安裝查詢Hive的步驟

本篇內(nèi)容主要講解“Presto分布式安裝查詢Hive的步驟”,感興趣的朋友不妨來看看。本文介紹的方法操作簡單快捷,實(shí)用性強(qiáng)。下面就讓小編來帶大家學(xué)習(xí)“Presto分布式安裝查詢Hive的步驟”吧!

我們提供的服務(wù)有:網(wǎng)站設(shè)計(jì)制作、網(wǎng)站設(shè)計(jì)、微信公眾號(hào)開發(fā)、網(wǎng)站優(yōu)化、網(wǎng)站認(rèn)證、昌平ssl等。為上1000家企事業(yè)單位解決了網(wǎng)站和推廣的問題。提供周到的售前咨詢和貼心的售后服務(wù),是有科學(xué)管理、有技術(shù)的昌平網(wǎng)站制作公司

    Hadoop的版本是2.7.2,Hive的版本是2.1.1,Presto的版本是0.197。Presto是個(gè)master-slave結(jié)果的查詢引擎,所以我們用三臺(tái)機(jī)器來安裝,如下List-1

    List-1

192.168.33.34 presto-coordinator
192.168.33.35 presto-slave1
192.168.33.36 presto-slave2

如下圖1

         Presto分布式安裝查詢Hive的步驟

                                                                                圖1

    每臺(tái)上都要安裝JDK,我使用的JDK版本是1.8.0_131,步驟略;將Hadoop集群上的Hadoop包拷貝到/opt上,將Hadoop加入到PATH中,每臺(tái)都是。

presto-coordinator

在presto-coordinator上,將presto安裝包放在/opt下,解壓,

1、config.properties,在etc下新建config.properties文件,文件內(nèi)容如下List-2

    List-2

coordinator=true
node-scheduler.include-coordinator=false
http-server.http.port=18080
query.max-memory=1GB
discovery-server.enabled=true
discovery.uri=http://192.168.33.34:18080
#是否允許presto server服務(wù)中即作為coordinator有作為worker,我們這是為false
node-scheduler.include-coordinator=false

2、jvm.config,在etc下新建jvm.config,文件內(nèi)容如下List-3

    List-3

-server
-XX:+UseConcMarkSweepGC
-XX:+ExplicitGCInvokesConcurrent
-XX:+CMSClassUnloadingEnabled
-XX:+AggressiveOpts
-XX:+HeapDumpOnOutOfMemoryError
-XX:OnOutOfMemoryError=kill -9 %p
-XX:ReservedCodeCacheSize=256M

3、log.properties,在etc下新建log.properties,文件內(nèi)容如下List-4

    List-4

com.facebook.presto=INFO

4、node.properties,在etc下新建node.properties,文件內(nèi)容如下List-5

    List-5

node.environment=production
node.id=node_master
node.data-dir=/opt/prestoserver/data

5、在etc下新建catalog目錄,在etc/catalog下新建hive.properties,如下List-6所示,192.168.33.33:9083是hive的metastore服務(wù)地址

    List-6

connector.name=hive-hadoop2
hive.metastore.uri=thrift://192.168.33.33:9083
hive.config.resources=/opt/hadoop/core-site.xml,/opt/hadoop/etc/hadoop/hdfs-site.xml

presto-slave1

    和presto-coordinator一樣,在etc下新建config.properties、jvm.config、log.properties、node.properties、catalog/hive.properties,只是config.properties的內(nèi)容和coordinator的不同,如下List-7,node.properties的值和coordinator的不同,如下List-8所示

    List-7  coordinator的值為false

coordinator=false
http-server.http.port=18080
query.max-memory=1GB
discovery-server.enabled=true
discovery.uri=http://192.168.33.34:18080
node-scheduler.include-coordinator=false

    List-8 node-id要修改

node.environment=production
node.id=node_node1
node.data-dir=/opt/prestoserver/data

presto-slave2

    在slave2上和slave1的一樣,只是node.properties的值和slave1的不同,如下List-9所示,將node.id修改為自己的

    List-9

node.environment=production
node.id=node_node2
node.data-dir=/opt/prestoserver/data

啟動(dòng)

  1. presto-coordinator上執(zhí)行"bin/launcher  run",這樣會(huì)將日志打印到控制臺(tái),我們好調(diào)試,如果是launcher  start則后臺(tái)運(yùn)行,看不到日志。

  2. presto-slave1上執(zhí)行"bin/launcher run"

  3. presto-slave2上執(zhí)行"bin/launcher run"

之后瀏覽器中訪問192.168.33.34:18080

Presto由三部分組成,

  1. 一個(gè)Coordinator節(jié)點(diǎn),Coordinator: 負(fù)責(zé)解析SQL語句,生成執(zhí)行計(jì)劃,分發(fā)執(zhí)行任務(wù)給Worker節(jié)點(diǎn)執(zhí)行

  2. 一個(gè)Discovery Server節(jié)點(diǎn),Discovery Server: 通常內(nèi)嵌于Coordinator節(jié)點(diǎn)中,worker會(huì)將自己注冊(cè)到這里

  3. 多個(gè)Worker節(jié)點(diǎn),負(fù)責(zé)實(shí)際執(zhí)行查詢?nèi)蝿?wù),負(fù)責(zé)與HDFS交互讀取數(shù)據(jù)

Presto查詢引擎低延遲的原因:

  1. 基于內(nèi)存的并行計(jì)算

  2. 流水線式計(jì)算作業(yè)

  3. 本地化計(jì)算

  4. 動(dòng)態(tài)編譯執(zhí)行計(jì)劃

Hive是存儲(chǔ)、計(jì)算引擎,不過Persto不做存儲(chǔ)。

Reference

  1. https://blog.51cto.com/simplelife/1967220

  2. https://www.liangzl.com/get-article-detail-40387.html

到此,相信大家對(duì)“Presto分布式安裝查詢Hive的步驟”有了更深的了解,不妨來實(shí)際操作一番吧!這里是創(chuàng)新互聯(lián)網(wǎng)站,更多相關(guān)內(nèi)容可以進(jìn)入相關(guān)頻道進(jìn)行查詢,關(guān)注我們,繼續(xù)學(xué)習(xí)!

網(wǎng)頁標(biāo)題:Presto分布式安裝查詢Hive的步驟
文章起源:http://muchs.cn/article22/jejsjc.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供品牌網(wǎng)站建設(shè)小程序開發(fā)、建站公司網(wǎng)站改版、App設(shè)計(jì)、營銷型網(wǎng)站建設(shè)

廣告

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

綿陽服務(wù)器托管