环境
- Ubuntu 22.04
- JDK 11
- Presto 0.278
安装
访问 https://prestodb.io ,下载最新的Presto包,我下载的文件是 presto-server-0.278.tar.gz :
# wget https://repo1.maven.org/maven2/com/facebook/presto/presto-server/0.278/presto-server-0.278.tar.gz
解压缩:
# tar -zxvf presto-server-0.278.tar.gz
创建 etc 目录:
# mkdir etc
在 etc 目录下创建 node.properties 文件,内容如下:
node.environment=production
node.id=ffffffff-ffff-ffff-ffff-ffffffffffff
node.data-dir=/var/presto/data
在 etc 目录下创建 jvm.config 文件,内容如下:
-server
-Xmx16G
-XX:+UseG1GC
-XX:G1HeapRegionSize=32M
-XX:+UseGCOverheadLimit
-XX:+ExplicitGCInvokesConcurrent
-XX:+HeapDumpOnOutOfMemoryError
-XX:+ExitOnOutOfMemoryError
在 etc 目录下创建 config.properties 文件,内容如下:
coordinator=true
node-scheduler.include-coordinator=true
http-server.http.port=8080
query.max-memory=5GB
query.max-memory-per-node=1GB
discovery-server.enabled=true
discovery.uri=http://example.net:8080
运行
官网上说,有两种运行方式:
bin/launcher start:后台运行bin/launcher run:前台运行
我们第一次启动Presto,要看看有没有什么报错信息,所以选择前台运行。
# bin/launcher run
报错如下:
/usr/bin/env: ‘python’: No such file or directory
没找到python。我看了一下,有 python3 :
# which python3
/usr/bin/python3
于是添加一个软连接:
# ln -s /usr/bin/python3 /usr/bin/python
再次运行Presto,又报错如下:
......
1) Error injecting constructor, java.io.IOException: java.io.IOException: Can not attach to current VM (try adding '-Djdk.attach.allowAttachSelf=true' to the JVM config)
at com.facebook.airlift.jmx.JmxAgent9.<init>(JmxAgent9.java:47)
at com.facebook.airlift.jmx.JmxModule.configure(JmxModule.java:55)
......
好吧,那就按它所说的,在 jvm.config 里添加一行:
-Djdk.attach.allowAttachSelf=true
再次运行Presto,这次成功了。
访问 http://<ip>:8080/ui ,如下:

参考
https://prestodb.io

1836

被折叠的 条评论
为什么被折叠?



