1、解压
tar -zxf trino-server-378.tar.gz -C /opt/module/trino/
mv trino-server-378 server-378
2、环境变量
#Trino
export PRESTO_HOME=/opt/module/trino/server-378
export PATH=$PRESTO_HOME/bin:$PATH
3、presto-cli
cp trino-cli-378-executable.jar /opt/module/trino/server-378/bin/trino
#添加trino的执行权限
chmod +x trino
4、配置
注:以下配置在/opt/module/trino/server-378/etc
config.properties
#单节点配置
coordinator=true
node-scheduler.include-coordinator=true
http-server.http.port=8084
http-server.threads.max=1500
query.max-memory=8GB
query.max-length=100000000
discovery.uri=http://IP:8084
task.max-worker-threads=32
failure-detector.threshold=0.10
exchange.max-error-duration=150m
exchange.http-client.request-timeout=30m
jvm.config
-server
-Xmx4G
-XX:-UseBiasedLocking
-XX:+UseG1GC
-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
-DHADOOP_USER_NAME=hive
log.properties
io.trino=INFO
node.properties
node.environment=trino_test
node.id=ffffffff-ffff-ffff-ffff-ffffffffffff
node.data-dir=/opt/module/trino/data
注:以下配置在/opt/module/trino/server-378/etc/catalog
hive.properties
#注意connector.name只能是hive-hadoop2
connector.name=hive-hadoop2
hive.metastore.uri=thrift://IP:9083
#填写自己的路径
hive.config.resources=/opt/module/trino/server-378/etc/core-site.xml,/opt/module/trino/server-378/etc/hdfs-site.xml
hive.allow-drop-table=true
hive.recursive-directories=true
#
hive.storage-format=PARQUET
hive.metastore-cache-ttl=0s
hive.metastore-refresh-interval=1s
hive.max-partitions-per-writers=1000
5、启动
指定jdk版本
vi bin/launcher
#配置自己的jdk11
export JAVA_HOME=/data/trino/jdk11.0.12
export PATH=$JAVA_HOME/bin:$PATH
#添加jdk判断
if [ -x "$JAVA_HOME/bin/java" ]; then
JAVA="/data/trino/jdk11.0.12/bin/java"
else
JAVA=`which java`
fi
#
exec "$(dirname "$0")/launcher.py" "$@"
bin/launcher start
6、操作
trino --server IP:8084 --catalog hive --schema ods