博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
greenplum 集群新增 standby节点
阅读量:6247 次
发布时间:2019-06-22

本文共 4081 字,大约阅读时间需要 13 分钟。

greenplum 单独添加 standby

本文主要介绍如何为没有做Standby的Master节点添加Standby。(快速整理版)

旧版本gp集群需要注意!!!!

在为Master节点搭建Standby的过程中,GreenPlum会自动关闭数据库,并以utility模式打开Master节点,然后修改gp_segment_configuration字典中增加Standby的信息,然后再关闭Master节点,将Master的数据拷贝到Standby节点,最后启动数据库,所以,在为Master节点添加Standby时,需要在空闲时段进行,否则会影响业务。

添加新节点需要完成如下工作:

参考信息:

1:新建gp 用户,用户id 与集群节点保持一直;2:新建数据目录,chown gpadmin.gpadmin $DIR;3:集群所有主机(Master节点和所有Segment节点)的hosts文件均需要添加Standby主机的信息。4:完成系统初始化(关闭防火墙,selinux ,sysctl.conf ,limits.conf ...),具体参考greenplum 集群安装初始化安装步骤;5:直接打通master节点 ssh 免密登陆新添加standby ;6:standby节点 ssh 免密登陆集群其它节点,通过gpssh工具测试;7:安装greenplum 软件包8:检查新添加standby 节点安装目录权限,chown gpadmin.gpadmin $DIR9:设置standby 节点gpadmin账户的环境变量,使之生效;以上确认配置没问题后:10.在Master节点通过gpinitstandby命令添加Standby。 (gpadmin 用户执行)[gpadmin@mdw config]$ gpinitstandby -s standby-node

操作实例:

[gpadmin@kangjianhua-6-16 ~]$ gpinitstandby -s kangjianhua-6-15.ptmind.comgpadmin-[INFO]:-Validating environment and parameters for standby initialization...gpadmin-[INFO]:-Checking for filespace directory /usr/local/gpdata/gpmaster/gpseg-1 on kangjianhua-6-15.ptmind.comgpadmin-[INFO]:------------------------------------------------------gpadmin-[INFO]:-Greenplum standby master initialization parametersgpadmin-[INFO]:------------------------------------------------------gpadmin-[INFO]:-Greenplum master hostname = kangjianhua-6-16.ptmind.comgpadmin-[INFO]:-Greenplum master data directory = /usr/local/gpdata/gpmaster/gpseg-1gpadmin-[INFO]:-Greenplum master port = 5432gpadmin-[INFO]:-Greenplum standby master hostname = kangjianhua-6-15.ptmind.comgpadmin-[INFO]:-Greenplum standby master port = 5432gpadmin-[INFO]:-Greenplum standby master data directory = /usr/local/gpdata/gpmaster/gpseg-1gpadmin-[INFO]:-Greenplum update system catalog = Ongpadmin-[INFO]:------------------------------------------------------gpadmin-[INFO]:- Filespace locationsgpadmin-[INFO]:------------------------------------------------------gpadmin-[INFO]:-pg_system -> /usr/local/gpdata/gpmaster/gpseg-1Do you want to continue with standby master initialization? Yy|Nn (default=N):> ygpadmin-[INFO]:-Syncing Greenplum Database extensions to standbygpadmin-[INFO]:-The packages on kangjianhua-6-15.ptmind.com are consistent.gpadmin-[INFO]:-Adding standby master to catalog...gpadmin-[INFO]:-Database catalog updated successfully.gpadmin-[INFO]:-Updating pg_hba.conf file...gpadmin-[INFO]:-pg_hba.conf files updated successfully.gpadmin-[INFO]:-Updating filespace flat files...gpadmin-[INFO]:-Filespace flat file updated successfully.gpadmin-[INFO]:-Starting standby mastergpadmin-[INFO]:-Checking if standby master is running on host: kangjianhua-6-15.ptmind.com in directory: /usr/local/gpdata/gpmaster/gpseg-120181115:18:06:06:176421 gpinitstandby:kangjianhua-6-16:gpadmin-[WARNING]:-Unable to cleanup previously started standby: 20181115:18:06:07:176421 gpinitstandby:kangjianhua-6-16:gpadmin-[INFO]:-Cleaning up pg_hba.conf backup files...20181115:18:06:08:176421 gpinitstandby:kangjianhua-6-16:gpadmin-[INFO]:-Backup files of pg_hba.conf cleaned up successfully.20181115:18:06:08:176421 gpinitstandby:kangjianhua-6-16:gpadmin-[INFO]:-Successfully created standby master on kangjianhua-6-15.ptmind.com

gpcc 问题处理:

greenplum master 节点迁移后,gpcc节点的配置要需要修改gpcc 连接节点的指向新的master地址:

gp 集群master切换后,需要修改:

/usr/local/gpcc/greenplum-cc-web-4.3.1/confcp app.conf app.conf.bakvim app.conf[gpadmin@kangjianhua-6-16 conf]$ more app.confappname = gpccwslistentcp4 = truerunmode = prodsession = trueenablexsrf = truexsrfexpire = 2592000xsrfkey = 61oETzKXQAGaYdkLxxxxxxxxxxxxxxrendertype = jsonprintallsqls = falsemaster_port = 5432path = /usr/local/gpccdisplay_name = gpccenable_kerberos = falseEnableHTTPS = falseEnableHTTP = truehttpport = 28080rpc_port = 8899master_host = kangjianhua-6-15.ptmind.com ==> kangjianhua-6-16.ptmind.com (新master) 《《《===修改内容查看状态:gpcc status启动服务:gpcc start#查看服务进程:ps  -ef|grep ccagent/usr/local/gpcc/greenplum-cc-web-4.3.1/bin/ccagent -udpport 9898 -rpcaddr kangjianhua-6-15.ptmind.com:8899安装参考:https://blog.51cto.com/michaelkang/2170631

转载于:https://blog.51cto.com/michaelkang/2317753

你可能感兴趣的文章
MyBatis从入门到放弃一:从SqlSession实现增删改查
查看>>
为apache安装mod_wsgi的时候出现-fpic的问题
查看>>
Node,Sockets,Cores,Threads
查看>>
java数组和字符串相互转换
查看>>
深刻理解Nginx之Nginx完整安装
查看>>
SelectSort
查看>>
实现浮点数的四舍五入RoundOff,保留几位小数
查看>>
Netty ByteBuf源码分析
查看>>
EWS 流通知订阅邮件
查看>>
Vuex实现原理解析
查看>>
Vue工程模板文件 webpack打包
查看>>
反射获取有参数的成员方法并执行
查看>>
解决Apache配置虚拟主机时出现403错误的问题
查看>>
TP框架中APP_SUB_DOMAIN_DEPLOY什么意思?
查看>>
DirectUI的优点及其自定义控件的开发
查看>>
用UglifyJS2合并压缩混淆JS代码
查看>>
Angular2入门:TypeScript的类型 - 对象解构
查看>>
apache spark kubernets 部署试用
查看>>
Windows下python3生成UTF8的CSV文件和sha256sum踩坑记录
查看>>
SPIHT 编码原理,代码,应用,专利问题
查看>>