【GreenPlum】使用gprecoverseg报gprecoverseg failed

当GP集群有问题时,使用gprecoverseg恢复时,可能会遇到如下问题:

[CRITICAL]:-gprecoverseg failed. (Reason='FATAL:  no pg_hba.conf entry for host "192.168.161.129", user "gpadmin", database "template1", SSL off

20200304:18:24:12:060245 gprecoverseg:cdh1:gpadmin-[INFO]:-2 segment(s) to recover
20200304:18:24:12:060245 gprecoverseg:cdh1:gpadmin-[INFO]:-Ensuring 2 failed segment(s) are stopped
20200304:18:24:13:060245 gprecoverseg:cdh1:gpadmin-[INFO]:-Ensuring that shared memory is cleaned up for stopped segments
20200304:18:24:14:060245 gprecoverseg:cdh1:gpadmin-[INFO]:-Updating configuration with new mirrors
20200304:18:24:14:060245 gprecoverseg:cdh1:gpadmin-[INFO]:-Updating mirrors
20200304:18:24:14:060245 gprecoverseg:cdh1:gpadmin-[INFO]:-Running pg_rewind on required mirrors
20200304:18:24:14:060245 gprecoverseg:cdh1:gpadmin-[CRITICAL]:-gprecoverseg failed. (Reason='FATAL:  no pg_hba.conf entry for host "192.168.161.129", user "gpadmin", database "template1", SSL off
') exiting...

在确定各节点hosts文件填写无误后,pg_hba.conf是最有可能出现问题的,可检查pg_hba.conf文件

把所有segment节点的pg_hba.conf修改完成后 重启GP数据库

再此使用gprecoverseg恢复时,成功了!

使用gprecoverseg -r 进行角色恢复

至此集群恢复正常~
(ip改变的话,此问题是比较容易的!)

 
角色:系统测试工程师 背景:擅长系统测试设计,擅长系统测试、自动化测试,安全测试等,是个综合的高级测试工程师 任务:根据用户输入的需求描述,完成测试设计 需求描述:greenplum分布式数据库,一个集群,安装在两个服务器上,针对gprecoverseg工具,编写测试用例,要求覆盖所有场景。 参考材料:gprecoverseg的参数: COMMAND NAME: gprecoverseg Recovers a primary or mirror segment instance that has been marked as down (if mirroring is enabled). ****************************************************** Synopsis ****************************************************** gprecoverseg [-p <new_recover_host>[,...]] |-i <recover_config_file> [-d <master_data_directory>] [-B <batch_size>] [-b <segment_batch_size>] [--differential] [-F] [-a] [-q] [-s] [--no-progress] [-l <logfile_directory>] gprecoverseg -r gprecoverseg -o <output_recover_config_file> [-p <new_recover_host>[,...]] gprecoverseg -? gprecoverseg --version ****************************************************** DESCRIPTION ****************************************************** In a system with mirrors enabled, the gprecoverseg utility reactivates a failed segment instance and identifies the changed database files that require resynchronization. Once gprecoverseg completes this process, the system goes into resyncronizing mode until the recovered segment is brought up to date. The system is online and fully operational during resyncronization. A segment instance can fail for several reasons, such as a host failure, network failure, or disk failure. When a segment instance fails, its status is marked as down in the Greenplum Database system catalog, and its mirror is activated in change tracking mode. In order to bring the failed segment instance back into operation again, you must first correct the problem that made it fail in the first place, and then recover the segment instance in Greenplum Database using gprecoverseg. Segment recovery using gprecoverseg requires that you have an active mirror to recover from. For systems that do not have mirroring enabled, or in the event of a double fa
03-15
<think>嗯,用户想针对Greenplumgprecoverseg工具设计覆盖所有场景的测试用例。首先,我需要了解gprecoverseg的基本功能和常用参数。这个工具主要用于恢复失效的segment实例,参数包括-i、-F、-a、-v、-l、-o等。不同的参数组合会影响恢复的方式和日志输出,所以测试用例需要覆盖这些参数的各种组合。 然后,用户提到的故障恢复场景,需要考虑到不同的故障类型,比如单节点故障、多节点故障、主备同时故障等。每种故障情况下的恢复流程可能不同,测试用例需要模拟这些场景,确保工具在各种情况下都能正确恢复。 接下来,兼容性方面,用户提供的引用内容提到了Oracle和MySQL的兼容性改进,这可能与Greenplum的兼容性需求有关。虽然gprecoversegGreenplum特有的工具,但测试时可能需要考虑与其他系统或数据类型的兼容性,比如恢复过程中是否会影响已有的兼容性特性,或者恢复后的集群是否仍然保持兼容性设置。 另外,用户的需求是设计“覆盖所有场景”的测试用例,这意味着需要全面考虑正常情况、异常情况、边界条件等。例如,测试用例应包括正常恢复流程、参数错误的情况、网络中断等异常情况的处理,以及大规模集群下的性能测试。 还需要考虑测试环境的不同配置,比如是否启用镜像、不同的数据分布策略等。不同的配置可能导致恢复行为的变化,测试用例需要覆盖这些配置组合。 最后,自动化测试和持续集成可能是用户需要考虑的,虽然用户没有明确提到,但设计测试用例时最好考虑到可自动化执行的可能性,以便在持续集成中快速验证代码变更是否影响了恢复功能。</think>针对Greenplumgprecoverseg工具测试用例设计,建议采用分层覆盖策略,从基础功能到复杂场景逐步推进: 一、参数组合测试(核心功能验证) 1. 基础恢复场景 - `gprecoverseg -a` 自动确认恢复 - `gprecoverseg -i recovery_config_file` 指定配置文件 - `gprecoverseg -F` 强制重建文件系统 - 混合参数如`gprecoverseg -aFv` 组合测试 2. 异常参数验证 - 无效配置文件路径测试 - 冲突参数组合(如同时使用-i和-F) - 权限不足场景模拟 二、故障场景模拟(分布式恢复验证) 1. 节点级故障 - 单primary节点失效(模拟磁盘损坏) - 单mirror节点故障(网络隔离测试) - 主备节点同时宕机(双节点故障恢复) 2. 网络异常场景 ```bash # 模拟网络抖动 iptables -A INPUT -p tcp --dport 40000:60000 -j DROP ``` - 恢复过程中断重试测试 - 跨机架网络延迟测试 3. 存储层异常 - 文件系统只读故障(使用`mount -o remount,ro`模拟) - 磁盘空间不足恢复测试(通过dd快速填充磁盘) 三、数据完整性验证 1. 事务一致性测试 - 在恢复前后执行`CHECKPOINT`和`VACUUM`操作 - 使用gpcheckcat工具进行目录校验 2. 特殊数据类型验证 ```sql CREATE TABLE json_test(data JSONB) DISTRIBUTED RANDOMLY; -- 验证JSON类型数据恢复完整性[^1] ``` 四、性能与扩展性测试 1. 大规模集群测试 - 100+节点集群恢复时效性测试 - 并行恢复进程资源消耗监控(通过nmon工具) 2. 负载压力测试 ```python # 使用多线程执行持续写入 from concurrent.futures import ThreadPoolExecutor def load_data(): execute("INSERT INTO stress_test VALUES (generate_series(1,1000000))") with ThreadPoolExecutor(max_workers=20) as executor: futures = [executor.submit(load_data) for _ in range(10)] ``` 五、高可用性验证 1. 滚动恢复测试 - 分段执行恢复并验证业务连续性 - 主备切换过程中查询路由验证 2. 增量恢复测试 - 使用`gprecoverseg -o incremental`参数 - 验证WAL日志同步完整性
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值