gpadmin-[CRITICAL]:-Error occurred: non-zero rc: 1

雅冰石發表於2020-11-18

一 問題描述

單機上安裝Greenplum,初始化gpinitsystem -c initgp_config時報錯:

20201118:11:13:10:005064 gpstart:pc205:gpadmin-[CRITICAL]:-Error occurred: non-zero rc: 1
 Command was: 'env GPSESSID=0000000000 GPERA=ade1c97359a87184_201118111308 $GPHOME/bin/pg_ctl -D /data/greenplum/data/master/gpseg-1 -l /data/greenplum/data/master/gpseg-1/pg_log/startup.log -w -t 600 -o " -p 5432 -E " start'
rc=1, stdout='waiting for server to start.... stopped waiting
', stderr='pg_ctl: could not start server

master程式未起來。

檢視上面提到的日誌/data/greenplum/data/master/gpseg-1/pg_log/startup.log,發現有如下報錯:

FATAL","XX000","could not map anonymous shared memory: Cannot allocate memory",,"This error usually means that PostgreSQL's request for a shared memory segment exceeded available memory, swap space, or huge pages. To reduce the request size (currently 234474364 bytes), reduce PostgreSQL's shared memory usage, perhaps by reducing shared_buffers or max_connections.",,,,,,"CreateAnonymousSegment","pg_shmem.c",587,1    0xbe84ec postgres errstart (elog.c:557)

二 出錯原因

記憶體不足

三 解決辦法

① vi /etc/sysctl.conf,新增:

vm.overcommit_memory = 2

#使修改生效

sysctl -p

② 給伺服器多分配些記憶體

如果是自己虛擬機器的話,可以殺掉伺服器上比較佔記憶體的程式

相關文章