Preston 官网:http://prestodb.io/
Preston Github 主页:https://github.com/facebook/presto
一 安装环境
二 安装Presto
wget https://repo1.maven.org/maven2/com/facebook/presto/presto-server/0.105/presto-server-0.105.tar.gz
tar -xf presto-server-0.105.tar.gz
node.environment=test
node.id=ffffffff-ffff-ffff-ffff-ffffffffffff
node.data-dir=/var/presto/data
参数说明:
node.environment
:环境名称。一个集群节点中的所有节点的名称应该保持一致。node.id
:节点唯一标识的名称。node.data-dir
:数据和日志存放路径
-server
-Xmx4G
-XX:+UseConcMarkSweepGC
-XX:+ExplicitGCInvokesConcurrent
-XX:+AggressiveOpts
-XX:+HeapDumpOnOutOfMemoryError
-XX:OnOutOfMemoryError=kill -9 %p
2.2.3 配置config.properties
coordinator=true
node-scheduler.include-coordinator=false
http-server.http.port=8001
task.max-memory=1GB
discovery-server.enabled=true
discovery.uri=http://10.199.xxx.xx:8001
参数说明:
coordinator
:Presto 实例是否以 coordinator 对外提供服务node-scheduler.include-coordinator
:是否允许在 coordinator 上进行调度任务http-server.http.port
:HTTP 服务的端口task.max-memory=1GB
:每一个任务(对应一个节点上的一个查询计划)所能使用的最大内存discovery-server.enabled
:是否使用 Discovery service 发现集群中的每一个节点。discovery.uri
:Discovery server 的 url
com.facebook.presto=INFO
设置某一个 java 包的日志等级2.2.5 关于 Catalog 的配置(与kafka连接配置)
connector.name=kafka
kafka.table-names=table1,table2
kafka.nodes=host1:port,host2:port
具体配置参考http://prestodb-china.com/docs/current/connector/kafka.html三 启动Presto
launcher --help
以后台方式启动prestolauncher start
一般启动方式,且输出并打印日志launcher run
停止prestolauncher stop
四 测试Presto CLI
wget https://repo1.maven.org/maven2/com/facebook/presto/presto-cli/0.100/presto-cli-0.100-executable.jar
将mv presto-cli-0.100-executable.jar重命名为prestomv presto-cli-0.100-executable.jar presto
将presto添加执行权限chmod 777 presto
启动presto cli./presto --server localhost:8001 --catalog kafka --schema default
执行show tables,如下