PRESTO部署和参数说明(一)

一,概要

在部署和使用presto的过程中,在此记录一下部署记录和使用记录以及需要注意的事项。本人使用的presto版本是0.214,3台redhat虚拟机。使用背景:客户需要定期查询大批量的数据,最后选择了sqoop工具定期导入hive,并且定期删除定期更新,因为没有找到是个实时增量导入的工具,批量执行mapreduce任务,然后使用分布式查询引擎presto查询数据。

二,安装部署

在官网下载最新的安装包和客户端包:

server安装包:https://prestodb.io/docs/current/installation/deployment.html

client连接包:https://prestodb.io/docs/current/installation/cli.html

我们有三台测试机器,测试机器的版本类型为:

LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: RedHatEnterpriseServer
Description: Red Hat Enterprise Linux Server release 6.7 (Santiago)
Release: 6.7
Codename: Santiago

我们要部署3个worker和一个Coordinator(附带一个Discovery Server节点)节点,并且这个master节点和一个worker节点部署同一台机器上。

第一步:下载完成之后,解压压缩包

tar -zxvf presto-server-0.214.tar.gz

第二步:解压之后,在目录presto-server-0.214中创建etc文件夹。进去etc文件夹,建立配置文件,我这里建立配置文件如下

config.properties: presto服务配置

node.properties:每个节点特定配置

jvm.properties:java虚拟机的命令行选项

log.properties:输出的日志级别

catalog目录:每个连着者配置

咱们一个一个的讲解:

config.properties

如果是Coordinator节点:注意 EXAMPLE.COM是指Coordinator节点的域名或者IP

coordinator=true
node-scheduler.include-coordinator=true
http-server.http.port=8080
query.max-memory=10GB
query.max-memory-per-node=3GB
query.max-total-memory-per-node=3GB
discovery-server.enabled=true
discovery.uri=http://EXAMPLE.COM:8080

  

如果是worker节点:

coordinator=false
http-server.http.port=8080
query.max-memory=10GB
query.max-memory-per-node=3GB
query.max-total-memory-per-node=3GB
discovery.uri=http://EXAMPLE.COM:8080

参数解释:

coordinator: 是否运行该实例为coordinator(接受client的查询和管理查询执行)。
node-scheduler.include-coordinator:coordinator是否也作为work。对于大型集群来说,在coordinator里做worker的工作会影响查询性能。
http-server.http.port:指定HTTP端口。Presto使用HTTP来与外部和内部进行交流。
query.max-memory: 查询能用到的最大总内存
query.max-memory-per-node: 查询能用到的最大单结点内存
discovery-server.enabled:

Presto使用Discovery服务去找到集群中的所有结点。每个Presto实例在启动时都会在Discovery服务里注册。这样可以简化部署,
不需要额外的服务,Presto的coordinator内置一个Discovery服务。也是使用HTTP端口。
discovery.uri: Discovery服务的URI。将example.net:8080替换为coordinator的host和端口。这个URI不能以斜杠结尾,这个错误需特别注意,不然会报404错误。

另外还有以下属性:
jmx.rmiregistry.port: 指定JMX RMI的注册。JMX client可以连接此端口
jmx.rmiserver.port: 指定JXM RMI的服务器。可通过JMX监听。

node.properties

node.environment=production
node.id=node01
node.data-dir=/var/presto/data

  

解释:

node.environment: 环境名字,Presto集群中的结点的环境名字都必须是一样的。

node.id: 唯一标识,每个结点的标识都必须是为一的。就算重启或升级Presto都必须还保持原来的标识。

node.data-dir: 数据目录,Presto用它来保存log和其他数据

jvm.properties

-server
-Xmx5G
-XX:+UseG1GC
-XX:G1HeapRegionSize=32M
-XX:+UseGCOverheadLimit
-XX:+ExplicitGCInvokesConcurrent
-XX:+HeapDumpOnOutOfMemoryError
-XX:OnOutOfMemoryError=kill -9 %p

  

JVM配置文件etc/jvm.config,包含启动Java虚拟机时的命令行选项。格式是每一行是一个命令行选项。此文件数据是由shell解析,所以选项中包含空格或特殊字符会被忽略。

log.properties

com.facebook.presto=INFO

  

备注:日志级别有四种,DEBUG, INFO, WARN and ERROR

catalog目录

在这里以hive为例子,我在客户端的配置如下:

connector.name=hive-hadoop2
hive.metastore.uri=thrift://10.18.14.170:9083
hive.config.resources=/etc/alternatives/hadoop-conf/core-site.xml,/etc/alternatives/hadoop-conf/hdfs-site.xml

  

第三步:启动presto服务和客户端命令

启动presto-server,进入目录bin目录执行。

./launcher start

其余选项可供参考:

Usage: launcher [options] command

Commands: run, start, stop, restart, kill, status

Options:
-h, --help show this help message and exit
-v, --verbose Run verbosely
--etc-dir=DIR Defaults to INSTALL_PATH/etc
--launcher-config=FILE
Defaults to INSTALL_PATH/bin/launcher.properties
--node-config=FILE Defaults to ETC_DIR/node.properties
--jvm-config=FILE Defaults to ETC_DIR/jvm.config
--config=FILE Defaults to ETC_DIR/config.properties
--log-levels-file=FILE
Defaults to ETC_DIR/log.properties
--data-dir=DIR Defaults to INSTALL_PATH
--pid-file=FILE Defaults to DATA_DIR/var/run/launcher.pid
--launcher-log-file=FILE
Defaults to DATA_DIR/var/log/launcher.log (only in
daemon mode)
--server-log-file=FILE
Defaults to DATA_DIR/var/log/server.log (only in
daemon mode)
-D NAME=VALUE Set a Java system property

  

启动presto-cli客户端:

把下载的jar包:presto-cli-0.214-executable.jar 重命名为:presto 并且赋予权限

chmod +x presto

执行进去命令以hive为例子:

/presto --server localhost:8080 --catalog hive --schema default

客户端其他命令供参考:

NAME
presto - Presto interactive console SYNOPSIS
presto [--access-token <access token>] [--catalog <catalog>]
[--client-info <client-info>]
[--client-request-timeout <client request timeout>]
[--client-tags <client tags>] [--debug] [--execute <execute>]
[(-f <file> | --file <file>)] [(-h | --help)]
[--http-proxy <http-proxy>] [--ignore-errors]
[--keystore-password <keystore password>]
[--keystore-path <keystore path>]
[--krb5-config-path <krb5 config path>]
[--krb5-credential-cache-path <krb5 credential cache path>]
[--krb5-disable-remote-service-hostname-canonicalization]
[--krb5-keytab-path <krb5 keytab path>]
[--krb5-principal <krb5 principal>]
[--krb5-remote-service-name <krb5 remote service name>]
[--log-levels-file <log levels file>] [--output-format <output-format>]
[--password] [--resource-estimate <resource-estimate>...]
[--schema <schema>] [--server <server>] [--session <session>...]
[--socks-proxy <socks-proxy>] [--source <source>]
[--truststore-password <truststore password>]
[--truststore-path <truststore path>] [--user <user>] [--version] OPTIONS
--access-token <access token>
Access token --catalog <catalog>
Default catalog --client-info <client-info>
Extra information about client making query --client-request-timeout <client request timeout>
Client request timeout (default: 2m) --client-tags <client tags>
Client tags --debug
Enable debug information --execute <execute>
Execute specified statements and exit -f <file>, --file <file>
Execute statements from file and exit -h, --help
Display help information --http-proxy <http-proxy>
HTTP proxy to use for server connections --ignore-errors
Continue processing in batch mode when an error occurs (default is
to exit immediately) --keystore-password <keystore password>
Keystore password --keystore-path <keystore path>
Keystore path --krb5-config-path <krb5 config path>
Kerberos config file path (default: /etc/krb5.conf) --krb5-credential-cache-path <krb5 credential cache path>
Kerberos credential cache path --krb5-disable-remote-service-hostname-canonicalization
Disable service hostname canonicalization using the DNS reverse
lookup --krb5-keytab-path <krb5 keytab path>
Kerberos key table path (default: /etc/krb5.keytab) --krb5-principal <krb5 principal>
Kerberos principal to be used --krb5-remote-service-name <krb5 remote service name>
Remote peer's kerberos service name --log-levels-file <log levels file>
Configure log levels for debugging using this file --output-format <output-format>
Output format for batch mode [ALIGNED, VERTICAL, CSV, TSV,
CSV_HEADER, TSV_HEADER, NULL] (default: CSV) --password
Prompt for password --resource-estimate <resource-estimate>
Resource estimate (property can be used multiple times; format is
key=value) --schema <schema>
Default schema --server <server>
Presto server location (default: localhost:8080) --session <session>
Session property (property can be used multiple times; format is
key=value; use 'SHOW SESSION' to see available properties) --socks-proxy <socks-proxy>
SOCKS proxy to use for server connections --source <source>
Name of source making query --truststore-password <truststore password>
Truststore password --truststore-path <truststore path>
Truststore path --user <user>
Username --version
Display version information and exit

  

查看web界面 http://EXAMPLE.COM:8080/ui/,举例说明:至此部署成功

PRESTO安装部署和参数说明(一)的更多相关文章

  1. presto 0.166安装部署

    系统:linux java:jdk 8,64-bit Connector:hive 分布式,node1-3 node1:Coordinator . Discovery service node2-3: ...

  2. Zabbix agent 在windows上安装部署

    Zabbix agent 在windows上安装部署 1.下载与解压 地址: http://www.zabbix.com/downloads/2.4.4/zabbix_agents_2.4.4.win ...

  3. Sqoop-1.4.6安装部署及详细使用介绍

    之所以选择Sqoop1是因为Sqoop2目前问题太多.无法正常使用,综合比较后选择Sqoop1. Sqoop1安装配置比较简单 一.安装部署 (1).下载安装包 下载地址:http://archive ...

  4. ArcGIS Enterprise 10.5.1 静默安装部署记录(Centos 7.2 minimal)- 4、安装 ArcGIS for Server

    安装ArcGIS for Server 解压server安装包,tar -xzvf ArcGIS_Server_Linux_1051_156429.tar.gz 切换到arcgis账户静默安装serv ...

  5. ArcGIS Enterprise 10.5.1 静默安装部署记录(Centos 7.2 minimal)- 3、安装Portal for ArcGIS

    安装Portal for ArcGIS 解压portal安装包,tar -xzvf Portal_for_ArcGIS_Linux_1051_156440.tar.gz 切换到arcgis账户静默安装 ...

  6. ArcGIS Enterprise 10.5.1 静默安装部署记录(Centos 7.2 minimal)- 2、安装WebAdapter

    解压webadapter安装包,tar -xzvf Web_Adaptor_Java_Linux_1051_156442.tar.gz 进入下Webadapter目录下静默安装 ./Setup -m ...

  7. Ranger安装部署

    1. 概述 Apache Ranger是大数据领域的一个集中式安全管理框架,目的是通过制定策略(policies)实现对Hadoop组件的集中式安全管理.用户可以通过Ranger实现对集群中数据的安全 ...

  8. 数据库中间件之mycat安装部署(一)

    在学习数据库中间件前,我们先抛出三个问题 1.数据库数据量不大,但并发读写操作很大,应该怎么办? 此时我们首先考虑使用缓存中间件来减轻读压力,如果不能满足则考虑数据库读写分离,此时就会引入新的问题,这 ...

  9. 2-MySQL DBA笔记-MySQL安装部署和入门

    第2章 MySQL安装部署和入门 第1章介绍了MySQL的一些基础知识,本章将为读者介绍MySQL的部署.安装及一些常用命令和参数的设置.2.1 如何选择MySQL版本 在选择MySQL的版本时,要根 ...

随机推荐

  1. Python序列的一点用法

    #python的基本语法网上已经有很多详细的解释了,写在这里方便自己记忆一些 序列,顾名思义,是一段数据的有序排列,列表,元组,字符串都是序列的一种,序列有很多BIF(BIF是内建方法,即python ...

  2. sqlloader 往数据库导数据提示数据文件的字段超出最大长度

    当我们用sqlloader往数据库导数据提示被拒绝,数据文件的字段超出最大长度.但是我们不管怎么改提示字段的长度的时候仍然提示超出最大长度. 这个是因为ctl文件中默认为char256,超过256需要 ...

  3. PAT A1046 Shortest Distance

    PAT A1046 Shortest Distance 标签(空格分隔): PAT TIPS: 最后一个数据点可能会超时 #include <cstdio> #include <al ...

  4. Adobe Flash Player 29.0.0.140官方正式版

    Adobe Flash Player 29 正式版例行更新,v29.0.0.140 这是最新详细版本号,Adobe采取和微软相似的更新策略,在每个月的第二个周二为产品发布安全更新.Adobe® Fla ...

  5. 初识Hibernate框架,进行简单的增删改查操作

    Hibernate的优势 优秀的Java 持久化层解决方案  (DAO) 主流的对象—关系映射工具产品 简化了JDBC 繁琐的编码 将数据库的连接信息都存放在配置文件 自己的ORM框架 一定要手动实现 ...

  6. 1019. General Palindromic Number (20)

    生词以及在文中意思 forward 向前地 backward 向后地 palindromic 回文的 base 基数(如十进制的10 和二进制的2) numeral system 数制 decimal ...

  7. Annotation(注解)介绍

    Annotation(注解)是什么: Annotation(注解) 官方的定义:    An annotation is a form of metadata, that can be added t ...

  8. tensorFlow入门实践(二)模块化

    实现过一个例子之后,对TensorFlow运行机制有了初步的了解,但脑海中还没有一个如何实现神经网络的一个架构模型.下面我们来探讨如何模块化搭建神经网络,完成数据训练和预测. 首先我们将整体架构分为两 ...

  9. Java IO总结

  10. c#计算器

    代码没有大的问题,但是起初点击控件无反应,原因是事件代码要自己敲,不能直接粘贴. using System;using System.Collections.Generic;using System. ...