presto-server-317 集群安装

[toc]

1、参考网址:

https://prestosql.io/docs/current/installation/deployment.html

2、机器准备

机器ip          hostname    职责
192.168.8.31  bigdata1    coordinator
192.168.8.32  bigdata2    worker
192.168.8.33  bigdata3    worker

以下命令是针对3台服务器

3、presto-server下载

Presto-server下载地址

https://repo1.maven.org/maven2/io/prestosql/presto-server/317/presto-server-317.tar.gz

4、安装jdk

JDK1.8+ 这里使用的是:

[root@bigdata1 presto]# java -version
java version "1.8.0_211"
Java(TM) SE Runtime Environment (build 1.8.0_211-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode)
[root@bigdata1 presto]#

5、安装presto

三台服务器分别执行

mkdir -p /home/bigdata/installed/presto
cd /home/bigdata/software
tar -zxvf presto-server-317.tar.gz -C /home/bigdata/installed/presto

6、配置单机presto

进入:

cd /home/bigdata/installed/presto/presto-server-317

在下面创建etc目录

[root@bigdata1 presto-server-317]# mkdir etc
[root@bigdata1 presto-server-317]# ls
bin  etc  lib  NOTICE  plugin  README.txt

[root@bigdata1 presto-server-317]# cd etc
[root@bigdata1 etc]# touch node.properties jvm.config config.properties log.properties
[root@bigdata1 etc]# mkdir catalog
[root@bigdata1 etc]# ls
catalog  config.properties  jvm.config  log.properties  node.properties
[root@bigdata1 etc]# touch catalog/jmx.properties

文件说明:
node.properties:每个节点的环境配置
jvm.config:jvm参数
config.properties:配置Presto Server参数
log.properties:配置日志等级
catalog:Catalog的配置 也就是数据链接properties存放目录很重要

6.1、配置node.properties

coordinator 节点配置如下:

node.environment=production #集群名
node.id=bigdata1
node.data-dir=/home/bigdata/installed/presto/data

worker1节点:

node.environment=production #集群名
node.id=bigdata2
node.data-dir=/home/bigdata/installed/presto/data

worker2节点:

node.environment=production #集群名
node.id=bigdata3
node.data-dir=/home/bigdata/installed/presto/data

6.2、配置jvm.config

三台服务器均配置如下:

-server
-Xmx16G
-XX:-UseBiasedLocking
-XX:+UseG1GC
-XX:G1HeapRegionSize=32M
-XX:+ExplicitGCInvokesConcurrent
-XX:+ExitOnOutOfMemoryError
-XX:+UseGCOverheadLimit
-XX:+HeapDumpOnOutOfMemoryError
-XX:ReservedCodeCacheSize=512M
-Djdk.attach.allowAttachSelf=true
-Djdk.nio.maxCachedBufferSize=2000000

6.3、配置config.properties
coordinator 节点配置如下:

coordinator=true
node-scheduler.include-coordinator=false
http-server.http.port=9999
query.max-memory=16GB
query.max-memory-per-node=1GB
query.max-total-memory-per-node=2GB
discovery-server.enabled=true #这个只需要coordinator节点配置即可,worker接点不需要
discovery.uri=http://192.168.8.31:9999 #集群使用的这个很关键,coordinator协调worker就靠它

两个worker节点配置如下:

coordinator=false
node-scheduler.include-coordinator=false
http-server.http.port=9999
query.max-memory=16GB
query.max-memory-per-node=1GB
discovery.uri=http://192.168.8.31:9999

如果是单台机器想测试的话,要配置成如下:

coordinator=true
node-scheduler.include-coordinator=true
http-server.http.port=9999
query.max-memory=5GB
query.max-memory-per-node=1GB
query.max-total-memory-per-node=2GB
discovery-server.enabled=true
discovery.uri=http://192.168.8.31:9999

6.4、配置log.properties

三台配置如下

io.prestosql=INFO

6.5、配置Catalog Properties

三台配置如下

vim catalog/jmx.properties
connector.name=jmx

6.6、配置防火墙

允许防火墙 放行我们配置的http-server.http.port端口不然会导致集群失败

6.7、启动presto

在bigdata1,bigdata2,bigdata3上分别执行启动

cd /home/bigdata/installed/presto/presto-server-317/bin
./launcher start

最后访问页面:http://192.168.8.31:9999/


image.png

你可能感兴趣的:(presto-server-317 集群安装)