greenplum参数调整,重启gpstop -r集群,发现集群无法启动,
查看Master节点以及Segment节点(primary和mirror)启动日志start.log($MASTER_DATA_DIRECTORY/pg_log/start.log),发现如下报错
2018-11-05 14:18:14.608417 CST,,,p2263,th-135653600,,,,0,,,seg-1,,,,,"LOG","00000","removing all temporary files",,,,,,,,"RemovePgTempFiles","fd.c",1890,
2018-11-05 14:18:14.616841 CST,,,p2263,th-135653600,,,,0,,,seg-1,,,,,"FATAL","XX000","could not create shared memory segment: Invalid argument (pg_shmem.c:183)","Failed system call was shmget(key=5432001, size=6400707776, 03600).",
"This error usually means that PostgreSQL's request for a shared memory segment exceeded your kernel's SHMMAX parameter. You can either reduce the request size or reconfigure the kernel with larger SHMMAX.
To reduce the request size (currently 6400707776 bytes), reduce PostgreSQL's shared_buffers parameter (currently 192000) and/or its max_connections parameter (currently 750).
If the request size is already small, it's possible that it is less than your kernel's SHMMIN parameter, in which case raising the request size or reconfiguring SHMMIN is called for.
The PostgreSQL documentation contains more information about shared memory configuration.",,,,,,"InternalIpcMemoryCreate","pg_shmem.c",183,1 0xb0768e postgres errstart + 0x4de
2 0x8de01f postgres PGSharedMemoryCreate + 0x23f
3 0x95f4d4 postgres CreateSharedMemoryAndSemaphores + 0x374
4 0x8fa01d postgres PostmasterMain + 0xc5d
5 0x7fc44f postgres main + 0x44f
6 0x318d61ed1d libc.so.6 __libc_start_main + 0xfd
7 0x4c4619 postgres <symbol not found> + 0x4c4619
解决:1、sysctl.conf内核参数shmmax设置过小
2、share_buffers设置过大
3、max_connections 设置过大
4、参数
effective_cache_size
share_buffers
work_mem
temp_buffers
gp_vmem_protect_limit
加起来超过了主机物理内存
5、若是启动失败,可以将所有主机上的postgres.conf(包括primary和mirror)配置文件对应值修改变小,因为Greenplum Master节点和Segment节点会读取自己本地的配置文件,重启集群,再逐渐去调整参数值
重启greenplum集群报错:
retrieve GUC information: FATAL: DTM initialization: failure during startup recovery, retry failed, check segment status (cdbtm.c:1603)
[gpadmin@master gpseg-1]$ gpconfig -s shared_buffers
20181105:15:59:58:003396 gpconfig:master:gpadmin-[ERROR]:-Failed to retrieve GUC information: FATAL: DTM initialization: failure during startup recovery, retry failed, check segment status (cdbtm.c:1603)
原因: shared_buffers 设置过大,超过2G
$ gpconfig -c shared_buffers -v 1000MB
$ gpstop -r
系统: centos-6.5
内存: 32G
SWAP: 4G
主要调整的几个参数如下:
连接数:
gpconfig -c max_connections -v 800 -m 500
shared_buffers:(最多设置2GB)
gpconfig -c shared_buffers -v 1000MB
effective_cache_size 缓存数据区 总内存的60%-80%
gpconfig -c effective_cache_size -v 25600MB
gpconfig -c work_mem -v 1600MB
gpconfig -c temp_buffers -v 4096
gpconfig -c gp_vmem_protect_limit -v 1000000000 单位:字节(bytes)
版权声明:本文为博主原创文章,未经博主允许不得转载。
- 上一篇:Greenplum 数据备份恢复
- 下一篇:GreenplumDB 迁移报错解决



