1、下载presto https://repo1.maven.org/maven2/com/facebook/presto/presto-server/
注意从0.86版本后只支持java 8,这里使用0.85版本+java 7,不然会出现
java.lang.UnsupportedClassVersionError: com/facebook/presto/server/PrestoServer : Unsupported major.minor version 52.0
2、解压tar包,进入conf目录,开始配置
config.properties
coordinator=true
node-scheduler.include-coordinator=false
http-server.http.port=10080
task.max-memory=5GB
discovery-server.enabled=true
discovery.uri=http://ip:10080
jvm.config
-server
-Xmx16G
-XX:+UseConcMarkSweepGC
-XX:+ExplicitGCInvokesConcurrent
-XX:+CMSClassUnloadingEnabled
-XX:+AggressiveOpts
-XX:+HeapDumpOnOutOfMemoryError
-XX:OnOutOfMemoryError=kill -9 %p
-XX:ReservedCodeCacheSize=150M
log.properties
com.facebook.presto=INFO
node.properties
node.environment=production
node.id=hostname-presto
node.data-dir=/var/presto/data
注意每台机器的node.properties里的node.id应该是唯一值,可用实际主机名替换hostname
复制core-site.xml、hdfs-site.xml到conf目录
3、在conf目录建立catalog目录
进入catalog目录,开始配置
hive.properties
connector.name=hive-cdh5
hive.metastore.uri=thrift://ip:9083
hive.config.resources=/usr/local/presto-server-0.85/etc/core-site.xml,/usr/local/presto-server-0.85/etc/hdfs-site.xml
jmx.properties
connector.name=jmx
4、以上为presto主结点配置,从结点修改
config.properties
coordinator=false
http-server.http.port=10080
task.max-memory=5GB
discovery-server.enabled=true
discovery.uri=http://ip:10080
以及注意node.properties里的node.id保持唯一
5、最后各台机器分发
启动关闭
/bin/launcher start
./bin/launcher stop
6、下载https://repo1.maven.org/maven2/com/facebook/presto/presto-cli/0.85/presto-cli-0.85-executable.jar
放入bin目录,重命名presto-cli,添加可执行权限,即可./presto-cli命令行进入
也可设置/etc/profile
export PRESTO_HOME=/usr/local/presto-server-0.85
alias presto='$PRESTO_HOME/bin/presto-cli --server ip:10080 --catalog hive --schema default'
参考
https://prestodb.io/
http://prestodb-china.com/
http://www.tuicool.com/articles/vU7rYzR