
cat << EOF >>/etc/security/limits.conf
presto soft nofile 131072
presto hard nofile 131072
EOF
tar xvf trino-server-391.tar
cd trino-server-391
mkdir etc
mkdir data
# 增加node.properties
# vi etc/node.properties
# 环境的名字。集群中所有的Trino节点必须具有相同的环境名称。
node.environment=trino
# 此Trino安装的唯一标识符。这对于每个节点都必须是唯一的。
node.id=2a1f445c-66d4-414e-bf6c-38cf252a6794
# 数据目录的位置(文件系统路径)。Trino在这里存储日志和其他数据。
node.data-dir=/data/services/trino-server-391/data
# 增加etc/jvm.config
# vi etc/jvm.config
-server
-Xmx16G
-XX:InitialRAMPercentage=80
-XX:MaxRAMPercentage=80
-XX:G1HeapRegionSize=32M
-XX:+ExplicitGCInvokesConcurrent
-XX:+ExitOnOutOfMemoryError
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
-XX:ReservedCodeCacheSize=512M
-XX:PerMethodRecompilationCutoff=10000
-XX:PerBytecodeRecompilationCutoff=10000
-Djdk.attach.allowAttachSelf=true
-Djdk.nio.maxCachedBufferSize=2000000
-XX:+UnlockDiagnosticVMOptions
-XX:+UseAESCTRIntrinsics
# 增加etc/config.properties
# coordinator和worker节点,该配置文件不一样,如下是coordinator配置
# vi etc/config.properties
coordinator=true
node-scheduler.include-coordinator=false
http-server.http.port=8080
discovery-server.enabled=true
discovery.uri=http://coordinator-ip:8080
# 所有节点查询可以使用的最大内存和
query.max-memory=30GB
query.max-total-memory=48GB
# 单个节点查询可以使用的最大用户内存
query.max-memory-per-node=10GB
# 增加etc/log.properties
# vi etc/log.properties
io.trino=INFO
# 新建 etc/catalog/hive.properties
mkdir etc/catalog
vi etc/catalog/hive.properties
connector.name=hive
hive.metastore.uri=thrift://hiveserver2-ip:9083
hive.config.resources=/data/services/trino-server-391/etc/core-site.xml,/data/services/trino-server-391/etc/hdfs-site.xml
# 修改etc/config.properties,coordinator和worker节点,该配置文件不一样
# vi etc/config.properties
coordinator=false
http-server.http.port=8080
discovery.uri=http://coordinator-ip:8080
# 前台启动,第一次建议以这种方式启动,方便观察日志
bin/launcher run
# 后台启动
bin/launcher start
http://coordinator-ip:8080/ui/login.html
用户名:trino, 密码为空


mv trino-cli-391-executable.jar trinochmod u+x trino./trino --server http://coordinator-ip:8080 --catalog hive --schema testshow tables下载 trino jdbc driver: https://trino.io/download.html

配置 dbeaver

配置驱动

测试连接

程序jdbc 连接,pom:
<dependency>
<groupId>io.trinogroupId>
<artifactId>trino-jdbcartifactId>
<version>391version>
dependency>