GreenPlum扩容节点
前言
扩容分为纵向扩容
和横向扩容
- 纵向扩容:增加segment数量
- 横向扩容:增加节点数
- 纵向扩容和横向扩容过程很相似,操作上只有很小的区别
一、纵向扩容
- 查看segment信息
gpstate -s
gpstate -b
psql template1
select * from gp_segment_configuraion;
- 扩容segment
- 创建一个文件,里面写入需要扩容segment的host
如:echo hadoop-poc6 > host_file
,这里要给hadoop-poc6节点纵向扩容。 - 根据提示进行生成input_file文件
gpexpand -f host_file -D test ## test是DB,不可以使用template1和template0 ##test可以自己事先创建:psql template1 && create database test;
- 根据提示会生成一个input文件,可以对它进行修改,如修改数据目录等
然后执行gpexpand -i [input_file] -D test
- 确认segment已经增加了
gpstate -s
- 创建一个文件,里面写入需要扩容segment的host
- 数据重新分布
gpexpand -a -d 1:00:00 -D test
## -d的参数可以根据需要经行修改,这里指的是最大持续时间一个小时
查看执行情况
psql test
select * from gpexpand.status;
- 删除schema
gpexpand -c -D test
二、横向扩容
操作和纵向扩容类似
不同的是:在host_file,这里需要填入原有的host和新增的host