欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  科技

presto-server-0.198集群安装

程序员文章站 2022-08-21 15:50:33
presto-server-0.198集群安装 1、机器准备 机器ip hostname 职责 192.168.18.140 bigdata1 coo...

presto-server-0.198集群安装

1、机器准备

机器ip          hostname    职责
192.168.18.140  bigdata1    coordinator
192.168.18.141  bigdata2    worker
192.168.18.142  bigdata3    worker

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

2、presto-server下载

Presto-server下载地址:https://prestodb.io/docs/current/installation/deployment.html
presto-server-0.198集群安装

3、安装jdk

JDK1.8+
注意的是Presto 0.198版本在jdk1.8.0_73下将安装失败,这里使用的是:

[root@bigdata3 ~]# java -version
java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)
[root@bigdata3 ~]#

4、安装presto

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

5、配置单机presto

进入:
cd /home/bigdata/installed/presto/presto-server-0.198

在下面创建etc目录
[root@bigdata1 presto-server-0.198]# mkdir etc
[root@bigdata1 presto-server-0.198]# ls
bin  etc  lib  NOTICE  plugin  README.txt

[root@bigdata1 presto-server-0.198]# 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

presto-server-0.198集群安装

文件说明:

node.properties:每个节点的环境配置
jvm.config:jvm参数
config.properties:配置Presto Server参数
log.properties:配置日志等级
catalog:Catalog的配置

5.1、配置node.properties

node.environment=bigdata_presto_cluster
node.id=bigdata_node_coordinator_bigdata1
node.data-dir=/home/bigdata/installed/presto/data

5.2、配置jvm.config

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

5.3、配置config.properties

coordinator=true
node-scheduler.include-coordinator=false
http-server.http.port=9999
query.max-memory=8GB
query.max-memory-per-node=1GB
discovery-server.enabled=true
discovery.uri=http://192.168.18.140:9999

如果是单台机器,要配置成如下(配置成下面的参数之后,16.6.1不用再配置了):

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

5.4、配置log.properties

com.facebook.presto=INFO

5.5、配置Catalog Properties

vim catalog/jmx.properties
connector.name=jmx

5.6、配置presto集群

将bigdata1中的presto远程拷贝到bigdata2,bigdata3中。

[root@bigdata1 presto-server-0.198]# cd /home/bigdata/installed/presto/presto-server-0.198
[root@bigdata1 presto-server-0.198]# scp -r etc root@bigdata2:$PWD
[root@bigdata1 presto-server-0.198]# scp -r etc root@bigdata3:$PWD

5.7、修改bigdata2,bigdata3上的config.properties

内容如下:

coordinator=false
http-server.http.port=9999
query.max-memory=8GB
query.max-memory-per-node=1GB
discovery.uri=http://192.168.18.140:9999

5.8、修改bigdata2,bigdata3上的node.properties

bigdata2上的内容是:

node.environment=bigdata_presto_cluster
node.id=bigdata_node_coordinator_bigdata2
node.data-dir=/home/bigdata/installed/presto/data

bigdata3上的内容是:

node.environment=bigdata_presto_cluster
node.id=bigdata_node_coordinator_bigdata3
node.data-dir=/home/bigdata/installed/presto/data

5.9、启动presto

在bigdata1,bigdata2,bigdata3上分别执行启动cd /home/bigdata/installed/presto/presto-server-0.198/bin里写图片描述](https://img-blog.csdn.net/20180415220216158?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3RvdG8xMjk3NDg4NTA0/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70)

[root@bigdata1 bin]# ./launcher start
如果想前台运行:./launcher run

访问页面:http://bigdata1:9999/
presto-server-0.198集群安装