下载和解压
#下载页面 http://prestodb.github.io/download.html
服务端:
presto-server-0.227.tar
客户端:
presto-cli-0.227-executable
配置文件目录结构及路径
/opt/presto-server-0.266.1/etc/
├── catalog
│ ├── cassandra.properties
│ └── mysql.properties
├── config.properties
├── jvm.config
├── log.properties
即需要在presto-server中先创建/etc,再创建配置文件
配置文件内容
config.properties
该方法为单机部署,分布式部署请参阅文档:https://prestodb.github.io/docs/current/installation/deployment.html
coordinator=true
node-scheduler.include-coordinator=true
http-server.http.port=8080
query.max-memory=5GB
query.max-memory-per-node=1GB
query.max-total-memory-per-node=2GB
discovery-server.enabled=true
discovery.uri=http://192.168.1.90:8080
exchange.http-client.request-timeout=300s
jvm.config
-server
-Xmx16G
-XX:+UseG1GC
-XX:G1HeapRegionSize=32M
-XX:+UseGCOverheadLimit
-XX:+ExplicitGCInvokesConcurrent
-XX:+HeapDumpOnOutOfMemoryError
-XX:+ExitOnOutOfMemoryError
-Djdk.attach.allowAttachSelf=true
log.properties
com.facebook.presto=DEBUG
node.properties
node.data-dir:日志文件地址,需要创建对应目录
node.environment=production
node.id=presto1
node.data-dir=/opt/presto-server-0.266.1/data
catalog 数据库节点配置
全部配置可参考文档:https://prestodb.io/docs/current/connector.html
cassandra.properties
connector.name=cassandra
cassandra.contact-points=192.168.1.1 #cassandra节点
cassandra.client.read-timeout=500s
mysql.properties
connector.name=mysql
connection-url=jdbc:mysql://localhost:3306
connection-user=root
connection-password=123456
启动
前台启动(可以查看输出日志)关窗口就停
./presto-server-0.266.1/bin/launcher run
启动成功,最后一条日志
2021-12-22T16:07:48.921+0800 INFO main com.facebook.presto.server.PrestoServer ======== SERVER STARTED ========
后台启动
./presto-server-0.266.1/bin/launcher start
关机
launcher stop
客户端连接
客户端:
presto-cli-0.227-executable
重命名为presto
执行命令:./presto
监控页面
http://localhost:8080/ui/#
参考文档
https://blog.csdn.net/weixin_41008393/article/details/90269228
https://prestodb.io/docs/current/connector.html