修改参数share_buffer
gpconfig -c shared_buffers -v 1536MB
重启使内存参数生效
[gpadmin@gp-master ~]$ gpstop -M fast
.......
[gpadmin@gp-master ~]$ gpstart
20160720:17:16:36:026125 gpstart:gp-master:gpadmin-[INFO]:-Starting gpstart with args:
20160720:17:16:36:026125 gpstart:gp-master:gpadmin-[INFO]:-Gathering information and validating the environment...
20160720:17:16:36:026125 gpstart:gp-master:gpadmin-[INFO]:-Greenplum Binary Version: 'postgres (Greenplum Database) 4.3.8.0 build 1'
20160720:17:16:36:026125 gpstart:gp-master:gpadmin-[INFO]:-Greenplum Catalog Version: '201310150'
20160720:17:16:36:026125 gpstart:gp-master:gpadmin-[INFO]:-Starting Master instance in admin mode
20160720:17:16:38:026125 gpstart:gp-master:gpadmin-[CRITICAL]:-Failed to start Master instance in admin mode
20160720:17:16:38:026125 gpstart:gp-master:gpadmin-[CRITICAL]:-Error occurred: non-zero rc: 1
Command was: 'env GPSESSID=0000000000 GPERA=None $GPHOME/bin/pg_ctl -D /disk/master/gpseg-1 -l /disk/master/gpseg-1/pg_log/startup.log -w -t 600 -o " -p 5432 -b 1 -z 0 --silent-mode=true -i -M master -C -1 -x 0 -c gp_role=utility " start'
rc=1, stdout='waiting for server to start...... stopped waiting
', stderr='pg_ctl: PID file "/disk/master/gpseg-1/postmaster.pid" does not exist
pg_ctl: could not start server
Examine the log output.
查看$MASTER_DATA_DIRECTORY/pg_log/startup.log日志,部分记录如下:
2016-07-20 17:16:37.102715 CST,,,p26136,th-2071148768,,,,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=1621864192, 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 1621864192 bytes), reduce PostgreSQL's shared_buffers parameter (currently 48000) and/or its max_connections parameter (currently 250).
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.
从报错来看是跟系统参数SHMMAX有关,
/etc/sysctl.conf中记录kernel.shmmax = 500000000 说明GP最大允许分配的内存segment是500000000/1024/1024约等于500M,刚刚我修改了GP的shared_buffers为1.5G,然后重启失败。
修改kernel.shmmax = 2500000000并执行sysctl -p重新载入系统参数(注:这个操作需要在所有GP节点上操作)。
然后GP启动成功。
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29989552/viewspace-2126802/
,如需转载,请注明出处,否则将追究法律责任。