Centos 6.9 配置 Presto

1. 解壓縮 presto-server-0.166.tar.gznode

tar -xzvf presto-server-0.166.tar.gz

2. 在 presto-server-0.166 目錄下建立 etc 目錄mysql

cd presto-server-0.166
mkdir etc

3. 在 etc 目錄下建立 catalog 目錄sql

cd etc
mkdir catalog

4. 在 catalog 目錄下建立文件 hive.properties ,文件內容以下apache

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

5. 在 etc 目錄下建立 config.properties , 文件內容以下bash

coordinator=true
node-scheduler.include-coordinator=true
http-server.http.port=8080
query.max-memory=512MB
query.max-memory-per-node=512MB
discovery-server.enabled=true
discovery.uri=http://bigdata:8080

6. 在 etc 目錄下建立 jvm.config , 文件內容以下jvm

-server
-Xmx1G
-XX:+UseG1GC
-XX:G1HeapRegionSize=32M
-XX:+UseGCOverheadLimit
-XX:+ExplicitGCInvokesConcurrent
-XX:+HeapDumpOnOutOfMemoryError
-XX:OnOutOfMemoryError=kill -9 %p

7. 在 etc 目錄下建立 node.properties , 文件內容以下oop

node.environment=production
node.id=bigdata
node.data-dir=/opt/presto-server-0.166/presto_data

8. 配置 presto clientrest

# 把客戶端jar包放置在presto-server-0.166/bin目錄下
mv presto-cli-0.166-executable.jar presto-server-0.166/bin
# 修改客戶端jar包名爲presto
mv presto-cli-0.166-executable.jar presto
# 修改presto客戶端jar包權限
chmod +x presto

9. 把 presto 添加到環境變量中 (~/.bash_profile)code

export PRESTO_HOME=/opt/presto-server-0.166
export PATH=$PRESTO_HOME/bin:$PATH
# 使環境變量當即生效
source ~/.bash_profile

10. 啓動 Prestoserver

presto 依賴 hdfs 和 hive metastore

# 啓動 HDFS
hadoop-2.7.4/sbin/start-dfs.sh
# 啓動 Hive metastore
sudo service mysqld start
nohup hive --service metastore >> /opt/apache-hive-2.1.1-bin/metastore.log 2>&1 &
# 啓動 Presto
presto-server-0.166/bin/launcher start

11. 驗證 presto 是否啓動

查看Presto Web UI

http://bigdata:8080

啓動 Presto 客戶端

presto --server bigdata:8080 --catalog hive --schema default
相關文章
相關標籤/搜索