Presto安装部署文档
young / / bigdata / 阅读量

主节点协调器安装

首先将presto.tar.gz 放在 软件安装目录比如 /web/soft/ 下,然后解压 tar –zxvf presto.tar.gz 解压后将压缩包删除

进入 /web/soft/presto/presto-server-0.232/etc 下 编辑 node.properties:

node.environment=production
node.id=hadoop1
node.data-dir=/web/soft/presto/data

node.id 是每个节点的唯一标识,每个节点id不一样;

node.data-dir 是日志配置文件等的目录,需要将 /web/soft替换为你软件的安装目录

进入 /web/soft/presto/presto-server-0.232/etc 下 编辑 config.properties:

coordinator=true
node-scheduler.include-coordinator=true
# server请求的端口
http-server.http.port=8888
# 查询计划在整个集群中所占用的总内存量
query.max-memory=8GB
# 查询计划在在每个节点上面占用最大内存
query.max-memory-per-node=1GB
# 每个查询在每台节点上面总的内存占用 
query.max-total-memory-per-node=2GB
discovery-server.enabled=true
# Ip 为主节点IP地址,8888端口需要与上面server请求端口保持一致
discovery.uri=http://10.255.53.197:8888

进入 /web/soft/presto/presto-server-0.232/etc 下 编辑

jvm.config:

-server
-Xmx10G
-XX:+UseG1GC
-XX:G1HeapRegionSize=32M
-XX:+UseGCOverheadLimit
-XX:+ExplicitGCInvokesConcurrent
-XX:+HeapDumpOnOutOfMemoryError
-XX:+ExitOnOutOfMemoryError

-Xmx10G 是Jvm 运行最大内存占用量,调整为 16G 即-Xmx16G,其他配置不动;

进入 /web/soft/presto/presto-server-0.232/etc/catalog 编辑hive.properties:

# 节点主机名
connector.name=hive-hadoop2
# 需要配置为节点IP
hive.metastore.uri=thrift://10.255.53.197:9083
# hadoop配置的目录
hive.config.resources=/web/soft/hadoop-2.6.5/etc/hadoop/core-site.xml,/web/soft/hadoop-2.6.5/etc/hadoop/hdfs-site.xml

主节点部署好后,进入 /web/soft/presto/presto-server-0.232/bin

前台启动:

./launcher run

然后查看前台日志是否报错

从节点工作器安装

直接将刚才安装好的presto 打包 /web/soft/presto 这个打包成presto.tar.gz 然后分发到其中一个从节点相同目录

进入 /web/soft/presto/presto-server-0.232/etc 编辑config.properties,将文件内容直接替换为以下内容(对应ip端口如果变了也请记得更改)

coordinator=false
http-server.http.port=8888
query.max-memory=20GB
query.max-memory-per-node=1GB
query.max-total-memory-per-node=2GB
discovery.uri=http://10.255.53.197:8888
# 注意:discovery.uri的IP也必须是主节点IP

进入 /web/soft/presto/presto-server-0.232/etc 编辑 node.properties;将 node.id 更改为该节点唯一标识

该从节点部署好后,同样 进入 /web/soft/presto/presto-server-0.232/bin

前台启动:

./launcher run

然后查看前台日志是否报错,

上面的从节点部署好后,同样将该从节点打包分发到其他从节点,然后其他从节点只需要将 /web/soft/presto/presto-server-0.232/etc 编辑 node.properties;将 node.id 更改为该节点唯一标识即可,如上步骤查看服务是否成功启动

所有节点部署好后并启动服务后,进入主节点 /web/soft/presto 目录,首先开启hive metastore服务 :

hive --service metastore &

然后开启presto客户端

./presto --server localhost:8888 --catalog hive --schema nginxlog

进入客户端执行命令:show schemas;

如果查询出数据说明安装完全成功

支付宝捐赠
请使用支付宝扫一扫进行捐赠
微信捐赠
请使用微信扫一扫进行赞赏
有 0 篇文章