Greenplum -- segment 死机后恢复

栏目: 数据库 · 发布时间: 6年前

内容简介:2.4、存在:Acting as Primary,说明有将mirror当primary使用了,必须等待所有恢复完毕之后,才能调换过来,调换过程会重启GPDB

一、备份原理:

GPDB4.x中:是基于文件复制同步,如果个别segment宕机,整个数据库依然可以运行,当Mirror宕机时,Primary会记录在这个阶段文件变化的数据块,等到Mirror恢复了,再把数据块复制过去;当Primary宕机了,那么对于的Mirror节点就会替换Primary,记录文件变化的数据块,等到Primary恢复了,它就变成了Mirror,丢失的数据就会被复制过来,这里虽然可以继续运行,但是存在一个问题,那就是Primary和Mirror调换了,导致个别机器Primary比其他机器多,负载不均衡,最好还是把它从新恢复过正常对应关系来

Greenplum -- segment 死机后恢复

二、恢复:

2.1、使用 sql 查询segment状态:

testdb=# select * from gp_segment_configuration;

存在部分segment down机的时候,在关闭的GPDB的时候,我们可以看到

Greenplum -- segment 死机后恢复

再次启动时也一样,GPDB会忽略掉down机的segment,同时开启mirror备用

Greenplum -- segment 死机后恢复

2.1、使用配置文件生成恢复文件

Greenplum -- segment 死机后恢复

可以看到生成的配置文件里包含了需要恢复的segment节点

Greenplum -- segment 死机后恢复

2.2、使用配置文件开始恢复机器

Greenplum -- segment 死机后恢复

2.3、开启另外一个窗口,查看恢复状态:gpstate -m

Resynchronizing:正在恢复中,必须等待所有的都Synchronized才行

Greenplum -- segment 死机后恢复

2.4、存在:Acting as Primary,说明有将mirror当primary使用了,必须等待所有恢复完毕之后,才能调换过来,调换过程会重启GPDB

执行命令:gprecoverseg -r

Greenplum -- segment 死机后恢复

2.5、全部交换之后,查看备用mirror的状态 gpstate -m

Greenplum -- segment 死机后恢复

2.6、sql查询各节点信息,都为up状态

Greenplum -- segment 死机后恢复


以上所述就是小编给大家介绍的《Greenplum -- segment 死机后恢复》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Data Structures and Algorithms in Java

Data Structures and Algorithms in Java

Robert Lafore / Sams / 2002-11-06 / USD 64.99

Data Structures and Algorithms in Java, Second Edition is designed to be easy to read and understand although the topic itself is complicated. Algorithms are the procedures that software programs use......一起来看看 《Data Structures and Algorithms in Java》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

随机密码生成器
随机密码生成器

多种字符组合密码

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码