Presto安装部署及使用

 

官方文档:https://prestodb.io/docs/current/installation/deployment.html

 

Presto安装环境

presto-server-0.191

hadoop-2.6.0-cdh5.8.3

Java8 8u92+
Python 2.4+
CentOS 64位
datadev1(coordinator)、datadev2(worker)、datadev3(worker)

 

注意:下面的步骤3台都要操作,worker 节点和coordinator节点只有config.properties有一点不一样

 

Presto配置

下载presto-server-0.191.tar.gz,并解压至/opt/presto
创建配置文件目录etc
cd /opt/presto/presto-server-0.191 && mkdir etc
cd etc

 

Node Properties 

 etc/node.properties

node.environment=production
node.id=datadev1
node.data-dir=/data/prestodata
 

注意:node.id 每个都不一样

 

 

JVM Config

  etc/jvm.config

-server
-Xmx16G
-XX:+UseG1GC
-XX:G1HeapRegionSize=32M
-XX:+UseGCOverheadLimit
-XX:+ExplicitGCInvokesConcurrent
-XX:+HeapDumpOnOutOfMemoryError
-XX:+ExitOnOutOfMemoryError
 
Config Properties

coordinator: etc/config.properties

coordinator=true
node-scheduler.include-coordinator=true  ##是否允许该节点既是coordinator又是worker
http-server.http.port=8080
query.max-memory=5GB
query.max-memory-per-node=1GB
discovery-server.enabled=true
discovery.uri=http://coordinatorIP:8080

 
work:etc/config.properties
coordinator=false
http-server.http.port=8080
query.max-memory=50GB
query.max-memory-per-node=1GB
discovery.uri=http://coordinatorIP:8080
 
注意:worker节点和coordinator节点discovery.uri都一样
 
Log Levels

etc/log.properties

com.facebook.presto=INFO
 
注意:日志在数据目录的/var/log
 
Catalog Properties

create etc/catalog/jmx.properties

connector.name=jmx

 

create etc/catalog/hive.properties

connector.name=hive-hadoop2
hive.metastore.uri=thrift://192.168.33.101:9083
hive.config.resources=/etc/hadoop/conf/core-site.xml, /etc/hadoop/conf/hdfs-site.xml
hive.allow-drop-table=true

 

注意:这是hive集群的相关配置信息

 

Running Presto

vi /etc/profile  增加

export JAVA_HOME=/opt/jdk1.8.0_111/
export PATH=$JAVA_HOME/bin:$PATH

/opt/presto-server-0.191/bin/launcher run

你可以使用下面命令后台启动:

bin/launcher start

也可以前台启动,观察输出日志:

bin/launcher run

另外,你也可以通过下面命令停止:

bin/launcher stop
 
 

Presto Cli

Download presto-cli-0.191-executable.jar, rename it to presto, make it executable with chmod +x, then run it:

mv presto-cli-0.191-executable.jar presto
chmod a+x presto

./presto --server localhost:8080 --catalog hive --schema default

进入Presto命令行。

image
 

Presto WEB Interface

3台都开启,访问http://coordinatorIP:8080 发现3个节点。
 
image
 
 

您可以选择一种方式赞助本站