签到成功

知道了

CNDBA社区CNDBA社区

Greenplum DB参数调整报错解决

2018-11-05 16:47 7079 0 原创 PostgreSQL
作者: Marvinn
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)
http://www.cndba.cn/Marvinn/article/3113
http://www.cndba.cn/Marvinn/article/3113 http://www.cndba.cn/Marvinn/article/3113 http://www.cndba.cn/Marvinn/article/3113 http://www.cndba.cn/Marvinn/article/3113
http://www.cndba.cn/Marvinn/article/3113
http://www.cndba.cn/Marvinn/article/3113 http://www.cndba.cn/Marvinn/article/3113 http://www.cndba.cn/Marvinn/article/3113 http://www.cndba.cn/Marvinn/article/3113

版权声明:本文为博主原创文章,未经博主允许不得转载。

用户评论
* 以下用户言论只代表其个人观点,不代表CNDBA社区的观点或立场
Marvinn

Marvinn

关注

路漫漫其修远兮、吾将上下而求索

  • 99
    原创
  • 0
    翻译
  • 2
    转载
  • 36
    评论
  • 访问:458468次
  • 积分:449
  • 等级:中级会员
  • 排名:第12名
精华文章
    最新问题
    查看更多+
    热门文章
      热门用户
      推荐用户
        Copyright © 2016 All Rights Reserved. Powered by CNDBA · 皖ICP备2022006297号-1·

        QQ交流群

        注册联系QQ