Presto集群部署(升级)

先说说上次对presto准备升级环节吧,因为预部署presto的机器本身部署了CDH集群(客户家的),机器为Centos6.x,按照Cloudrea官网上说的那部机器上的JDK是不能动。后来发现他JDK的环境变量是写在/etc/profile下的,即想着在一把用户下新建PATH写进去以用户自己的PATH优先 — 这么做是可以的 当然当时没成功是因为自己忘了在PATH之前写$,… 一把辛酸泪

老样子先放包的地址:链接:https://pan.baidu.com/s/1U676CujPaD8kfjrkXgj0qQ
提取码:zvy0

一、环境准备
1.服务角色分布

IP地址 职责
172.16.180.4 coordinator
172.16.180.17 worker
172.16.180.3 worker
172.16.180.3 worker

2.安装包
在这里插入图片描述
需要在开始的百度网盘拿

二、部署
1、 安装JDK
不在详细赘述,需要注意,官网的解释是presto-server-0.229.tar.gz版本要求jdk版本在jdk-6u115及以上,经过实地在生产环境上的测试(jdk-8u45-linux-x64.gz)这个版本是不行的,后来换了这个版本(jdk-8u221-linux-x64.tar.gz)才OK,第一次部署的环境变量最好写到/etc/profile,若存在JDK,环境变量写到对应用户的.bashrc下

2.安装presto
1)新建presto用户,并上传presto-server-0.229.tar.gz到/home/presto/目录下

# useradd presto
# chown -R presto. presto /home/presto
# su – presto
$ tar -zxvf presto-server-0.229.tar.gz

2)修改配置文件(172.16.180.12上操作)

# su – presto
$ cd /home/presto/presto-server-0.229
$ mkdir etc
$ cd etc/
$ touch node.properties
$ touch jvm.config
$ touch config.properties
$ touch log.properties
$ mkdir catalog
$ cd catalog
$ touch hive.properties
$ mkdir hive ##将hive的配置文件core-site.xml、hdfs-site.xml上传到此文件下
$ vi hive.properties
	connector.name=hive-hadoop2
	hive.metastore.uri=thrift://172.16.180.4:9083
	hive.config.resources=/home/presto/presto-server-0.229/etc/catalog/hive/core-site.xml,/home/presto/presto-server-0.229/etc/catalog/hive/hdfs-site.xml
:wq保存退出
$ cd ..
$ vi config.properties
coordinator=true
node-scheduler.include-coordinator=true
http-server.http.port=19999
query.max-memory=8GB
query.max-memory-per-node=2GB
discovery-server.enabled=true
discovery.uri=http://172.16.180.12:19999
:wq保存退出
$ vi jvm.config
-server
-Xmx8G
-XX:+UseG1GC
-XX:G1HeapRegionSize=32M
-XX:+UseGCOverheadLimit
:wq保存退出
$ vi log.properties
com.facebook.presto=INFO #输出日志级别
:wq保存退出
$ vi node.properties
node.environment=production
node.id=cgn_presto_coordinator_node1 #节点唯一标识
node.data-dir=/home/presto/presto-server-0.229/data
:wq保存退出
$ exit
# scp -r /home/presto/presto-server-0.229 [email protected]: /home/presto/
# scp -r /home/presto/presto-server-0.229 [email protected]: /home/presto/

修改172.16.180.17、172.16.180.3上的config.properties和node.properties,其中config.properties一样,如下:

coordinator=false
http-server.http.port=19999
query.max-memory=8GB
query.max-memory-per-node=2GB
discovery.uri=http://172.16.180.12:19999

172.16.180.17上node.properties如下:

node.environment=production
node.id=cgn_presto_coordinator_node2
node.data-dir=/home/presto/presto-server-0.229/data

172.16.180.3上node.properties如下:

node.environment=production
node.id=cgn_presto_coordinator_node3
node.data-dir=/home/presto/presto-server-0.229/data
  1. 在172.16.180.12、172.16.180.17、172.16.180.3上启动presto
$ cd /home/presto/presto-server-0.229/bin
$ ./launcher start

在这里插入图片描述
出现以上信息即为启动成功。
浏览器登录:http://172.16.180.12:19999
在这里插入图片描述
4)上传presto-cli-0.229-executable.jar至/home/presto/presto-server-0.229/bin目录下(连接hive数据仓库)

$ cd /home/presto/presto-server-0.229/bin
$ mv presto-cli-0.229-executable.jar presto
$ chmod +x presto
$ vi hive.sh 
./presto --server 172.16.180.12:19999 --catalog hive --schema test
:wq保存退出
$ ./hive.sh

在这里插入图片描述
连接成功!
三、错误解决
1)错误1在这里插入图片描述
解决:给config.properties中加入这个参数:query.max-total-memory-per-node=2GB(2GB的值作为参考)
2)若是出现这种错误:(注入构造函数错误,java.lang。无效的内存配置。每个节点的最大查询总内存(2147483648)和堆头空间(644245094)之和不能大于可用堆内存(2147483648)
在这里插入图片描述
解决:修改etc/jvm.config文件的-Xmx2G参数调节大小

发布了10 篇原创文章 · 获赞 0 · 访问量 396

猜你喜欢

转载自blog.csdn.net/Student_xx/article/details/104266141