Presto的基本环境:
Linux或Mac OS X
Java 8,64位(小版本151以上)
Python 2.4+
tar -zxvf presto-server-0.216.tar.gz -C /opt/cloudera/parcels/
# 创建软连接
sudo ln -s presto-server-0.228 PRESTO
# 更改权限
sudo chown cloudera-scm:cloudera-scm PRESTO presto-server-0.228
sudo vim ${PRESTO_HOME}/bin/launcher
# 添加:
export JAVA_HOME=/usr/java/jdk1.8
export PATH=$PATH:$JAVA_HOME/bin
mkdir -p etc
vim node.properties
#
# 集群名称,不能包含特殊字符如“-”
node.environment=presto-cluster
# 节点ID,节点间不能相同
node.id=presto-cdh001
# presto的数据路径
node.data-dir=/opt/data/presto
vim jvm.config
#
-server
-Xmx8G
-XX:+UseG1GC
-XX:G1HeapRegionSize=32M
-XX:+UseGCOverheadLimit
-XX:+ExplicitGCInvokesConcurrent
-XX:+HeapDumpOnOutOfMemoryError
-XX:+ExitOnOutOfMemoryError
vim log.properties
#
# INFO / WARN / ERROR
com.facebook.presto=INFO
vim config.properties
#
coordinator=true
node-scheduler.include-coordinator=true
http-server.http.port=8090
query.max-memory=4GB
query.max-memory-per-node=1GB
discovery-server.enabled=true
discovery.uri=http://10.18.100.116:8090
vim config.properties
#
coordinator=false
http-server.http.port=8090
query.max-memory=4GB
query.max-memory-per-node=1GB
discovery.uri=http://10.18.100.116:8090
vim hive.properties
#
# 连接名hive-hadoop2不可修改
connector.name=hive-hadoop2
hive.metastore.uri=thrift://10.18.100.115:9083
vim mysql.properties
#
connector.name=mysql
connection-url=jdbc:mysql://10.18.100.115:3306
connection-user=root
connection-password=root
# 启动
/opt/cloudera/parcels/presto/bin/launcher start
# 停止
/opt/cloudera/parcels/presto/bin/launcher start
http://coordinator:port
,可查看Presto的运行状态git clone https://github.com/yanagishima/yanagishima.git
cd yanagishima
git checkout -b [version] refs/tags/[version] ./gradlew distZip
unzip yanagishima-20.0
cd yanagishima-20.0
vim conf/yanagishima.properties
# Web服务端口
jetty.port=7080
# 查询超时时间,单位秒,超过则取消查询
presto.query.max-run-time-seconds=1800
# 查询结果大小阈值,超过则取消查询
presto.max-result-file-byte-size=1073741824
# 数据源名称可自由指定,但必须同 presto.coordinator.server、presto.redirect.server、catalog、schema 保持一致
presto.datasources=presto
# 是否启用用户认证
auth.presto=false
# Coordinator URL
presto.coordinator.server.presto=http://10.18.100.116:8090
# 通常与 Coordinator URL 相同
presto.redirect.server.presto=http://10.18.100.116:8090
# Presto catalog name
catalog.presto=hive
# Presto schema name
schema.presto=default
# 如果查询结果超出此限制,则跳过显示其余结果的操作
select.limit=500
# 日志的http头部名称
audit.http.header.name=some.auth.header
use.audit.http.header.name=false
# 从tsv转换为值查询的限制
to.values.query.limit=500
# 用户授权
check.datasource=false
hive.jdbc.url.hive=jdbc:hive2://10.18.100.115:10000/default;auth=noSasl
hive.jdbc.user.hive=yanagishima
hive.jdbc.password.hive=yanagishima
hive.query.max-run-time-seconds=3600
hive.query.max-run-time-seconds.hive=3600
resource.manager.url.hive=http://10.18.100.115:8088
sql.query.engines=presto
hive.datasources=hive
hive.disallowed.keywords.hive=insert,drop
# 查询结果大小阈值,超过则取消查询
hive.max-result-file-byte-size=1073741824
hive.setup.query.path.hive=/usr/local/yanagishima/conf/hive_setup_query_hive
cors.enabled=false
# 启动
nohup bin/yanagishima-start.sh >/dev/null 2>&1 &
# 停止
bin/yanagishima-shutdown.sh
http://10.18.100.116:7080
进行查询灯操作;