Quantcast
Channel: PostgreSQL research
Viewing all articles
Browse latest Browse all 253

CentOS 7.2 gpinitsystem error -Failed to complete obtain psql count Master gp_segment_configuration Script Exiting!

$
0
0

this version

commit 7065077b4fef5acf41e67b5240771db021d52156
Author: Shang Shujie <sshang@pivotal.io>
Date:   Wed Dec 16 14:53:34 2015 +0800

    fix bug: parquet can't write null out, with test case

when i use gpinitsystem init greenplum database. 
ERROR.

[postgres@digoal ~]$ grep "^[a-Z]" gpinitsystem_config 
ARRAY_NAME="EMC Greenplum DW"
SEG_PREFIX=gpseg
PORT_BASE=40000
declare -a DATA_DIRECTORY=(/data01/gpdata /data01/gpdata)
MASTER_HOSTNAME=digoal.com
MASTER_DIRECTORY=/data01/gpdata
MASTER_PORT=1999
TRUSTED_SHELL=ssh
CHECK_POINT_SEGMENTS=16
ENCODING=UTF-8
MACHINE_LIST_FILE=/home/postgres/host
[postgres@digoal ~]$ cat host
digoal.com
[postgres@digoal ~]$ ssh digoal.com date
Mon Dec 21 22:27:05 CST 2015

[postgres@digoal ~]$ gpinitsystem -c ./gpinitsystem_config --locale=C --max_connections=32 --shared_buffers=256MB --su_password=digoal -B 1

20151221:22:22:01:015135 gpinitsystem:digoal:postgres-[INFO]:-Checking new segment hosts, Completed
20151221:22:22:01:015135 gpinitsystem:digoal:postgres-[INFO]:-Greenplum Database Creation Parameters
20151221:22:22:01:015135 gpinitsystem:digoal:postgres-[INFO]:---------------------------------------
20151221:22:22:01:015135 gpinitsystem:digoal:postgres-[INFO]:-Master Configuration
20151221:22:22:01:015135 gpinitsystem:digoal:postgres-[INFO]:---------------------------------------
20151221:22:22:01:015135 gpinitsystem:digoal:postgres-[INFO]:-Master instance name       = EMC Greenplum DW
20151221:22:22:01:015135 gpinitsystem:digoal:postgres-[INFO]:-Master hostname            = digoal.com
20151221:22:22:01:015135 gpinitsystem:digoal:postgres-[INFO]:-Master port                = 1999
20151221:22:22:01:015135 gpinitsystem:digoal:postgres-[INFO]:-Master instance dir        = /data01/gpdata/gpseg-1
20151221:22:22:01:015135 gpinitsystem:digoal:postgres-[INFO]:-Master LOCALE              = C
20151221:22:22:01:015135 gpinitsystem:digoal:postgres-[INFO]:-Greenplum segment prefix   = gpseg
20151221:22:22:01:015135 gpinitsystem:digoal:postgres-[INFO]:-Master Database            = 
20151221:22:22:01:015135 gpinitsystem:digoal:postgres-[INFO]:-Master connections         = 32
20151221:22:22:01:015135 gpinitsystem:digoal:postgres-[INFO]:-Master buffers             = 256MB
20151221:22:22:01:015135 gpinitsystem:digoal:postgres-[INFO]:-Segment connections        = 96
20151221:22:22:01:015135 gpinitsystem:digoal:postgres-[INFO]:-Segment buffers            = 256MB
20151221:22:22:01:015135 gpinitsystem:digoal:postgres-[INFO]:-Checkpoint segments        = 16
20151221:22:22:01:015135 gpinitsystem:digoal:postgres-[INFO]:-Encoding                   = UTF-8
20151221:22:22:01:015135 gpinitsystem:digoal:postgres-[INFO]:-Postgres param file        = Off
20151221:22:22:01:015135 gpinitsystem:digoal:postgres-[INFO]:-Initdb to be used          = /opt/gpdb/bin/initdb
20151221:22:22:01:015135 gpinitsystem:digoal:postgres-[INFO]:-GP_LIBRARY_PATH is         = /opt/gpdb/lib
20151221:22:22:01:015135 gpinitsystem:digoal:postgres-[INFO]:-Ulimit check               = Passed
20151221:22:22:01:015135 gpinitsystem:digoal:postgres-[INFO]:-Array host connect type    = Single hostname per node
20151221:22:22:01:015135 gpinitsystem:digoal:postgres-[INFO]:-Master IP address [1]      = ::1
20151221:22:22:01:015135 gpinitsystem:digoal:postgres-[INFO]:-Master IP address [2]      = 192.168.0.157
20151221:22:22:01:015135 gpinitsystem:digoal:postgres-[INFO]:-Master IP address [3]      = fe80::e2ca:94ff:fed5:c894
20151221:22:22:01:015135 gpinitsystem:digoal:postgres-[INFO]:-Standby Master             = Not Configured
20151221:22:22:01:015135 gpinitsystem:digoal:postgres-[INFO]:-Primary segment #          = 2
20151221:22:22:01:015135 gpinitsystem:digoal:postgres-[INFO]:-Total Database segments    = 2
20151221:22:22:01:015135 gpinitsystem:digoal:postgres-[INFO]:-Trusted shell              = ssh
20151221:22:22:01:015135 gpinitsystem:digoal:postgres-[INFO]:-Number segment hosts       = 1
20151221:22:22:01:015135 gpinitsystem:digoal:postgres-[INFO]:-Mirroring config           = OFF
20151221:22:22:01:015135 gpinitsystem:digoal:postgres-[INFO]:----------------------------------------
20151221:22:22:01:015135 gpinitsystem:digoal:postgres-[INFO]:-Greenplum Primary Segment Configuration
20151221:22:22:01:015135 gpinitsystem:digoal:postgres-[INFO]:----------------------------------------
20151221:22:22:01:015135 gpinitsystem:digoal:postgres-[INFO]:-digoal.com        /data01/gpdata/gpseg0   40000   2       0
20151221:22:22:01:015135 gpinitsystem:digoal:postgres-[INFO]:-digoal.com        /data01/gpdata/gpseg1   40001   3       1
Continue with Greenplum creation Yy/Nn>
y
20151221:22:22:02:015135 gpinitsystem:digoal:postgres-[INFO]:-Building the Master instance database, please wait...
20151221:22:22:17:015135 gpinitsystem:digoal:postgres-[INFO]:-Starting the Master in admin mode
20151221:22:22:31:gpinitsystem:digoal:postgres-[FATAL]:-Failed to complete obtain psql count Master gp_segment_configuration  Script Exiting!
20151221:22:22:31:015135 gpinitsystem:digoal:postgres-[WARN]:-Script has left Greenplum Database in an incomplete state
20151221:22:22:31:015135 gpinitsystem:digoal:postgres-[WARN]:-Run command /bin/bash /home/postgres/gpAdminLogs/backout_gpinitsystem_postgres_20151221_222157 to remove these changes
20151221:22:22:31:015135 gpinitsystem:digoal:postgres-[INFO]:-Start Function BACKOUT_COMMAND
20151221:22:22:31:015135 gpinitsystem:digoal:postgres-[INFO]:-End Function BACKOUT_COMMAND

LOG file:

20151221:22:22:18:015135 gpinitsystem:digoal:postgres-[INFO]:-Completed starting the Master in admin mode
20151221:22:22:25:015135 gpinitsystem:digoal:postgres-[INFO]:-Start Function PING_HOST
20151221:22:22:25:015135 gpinitsystem:digoal:postgres-[INFO]:-digoal.com contact established
20151221:22:22:25:015135 gpinitsystem:digoal:postgres-[INFO]:-End Function PING_HOST
20151221:22:22:25:015135 gpinitsystem:digoal:postgres-[INFO]:-Start Function UPDATE_GPCONFIG
tail: gpinitsystem_20151221.log: file truncated
20151221:22:22:25:015135 gpinitsystem:digoal:postgres-[INFO]:-Start Function ERROR_CHK
20151221:22:22:25:015135 gpinitsystem:digoal:postgres-[INFO]:-Successfully completed obtain psql count Master gp_segment_configuration
20151221:22:22:25:015135 gpinitsystem:digoal:postgres-[INFO]:-End Function ERROR_CHK
20151221:22:22:25:015135 gpinitsystem:digoal:postgres-[INFO]:-Adding -1 on digoal.com /data01/gpdata/gpseg-1 to system configuration table
INSERT 0 1
20151221:22:22:25:015135 gpinitsystem:digoal:postgres-[INFO]:-Start Function ERROR_CHK
20151221:22:22:25:015135 gpinitsystem:digoal:postgres-[INFO]:-Successfully completed add -1 on digoal.com to Master gp_segment_configuration
20151221:22:22:25:015135 gpinitsystem:digoal:postgres-[INFO]:-End Function ERROR_CHK
20151221:22:22:25:015135 gpinitsystem:digoal:postgres-[INFO]:-Adding -1 on digoal.com /data01/gpdata/gpseg-1 to Master gp_filespace_entry
INSERT 0 1
20151221:22:22:26:015135 gpinitsystem:digoal:postgres-[INFO]:-Start Function ERROR_CHK
20151221:22:22:26:015135 gpinitsystem:digoal:postgres-[INFO]:-Successfully completed add -1 on digoal.com /data01/gpdata/gpseg-1 to Master pg_filespace_entry
20151221:22:22:26:015135 gpinitsystem:digoal:postgres-[INFO]:-End Function ERROR_CHK
20151221:22:22:26:015135 gpinitsystem:digoal:postgres-[INFO]:-End Function UPDATE_GPCONFIG
20151221:22:22:26:015135 gpinitsystem:digoal:postgres-[INFO]:-Start Function LOAD_QE_SYSTEM_DATA
20151221:22:22:26:015135 gpinitsystem:digoal:postgres-[INFO]:-Adding segment digoal.com to Master system tables
20151221:22:22:31:015135 gpinitsystem:digoal:postgres-[INFO]:-Start Function PING_HOST
20151221:22:22:31:015135 gpinitsystem:digoal:postgres-[INFO]:-digoal.com contact established
20151221:22:22:31:015135 gpinitsystem:digoal:postgres-[INFO]:-End Function PING_HOST
20151221:22:22:31:015135 gpinitsystem:digoal:postgres-[INFO]:-Start Function UPDATE_GPCONFIG
tail: gpinitsystem_20151221.log: file truncated
psql: FATAL:  semctl(17530881, 14, SETVAL, 0) failed: Invalid argument (pg_sema.c:151)
20151221:22:22:31:015135 gpinitsystem:digoal:postgres-[INFO]:-Start Function ERROR_CHK
20151221:22:22:31:015135 gpinitsystem:digoal:postgres-[INFO]:-End Function ERROR_CHK
20151221:22:22:31:015135 gpinitsystem:digoal:postgres-[INFO]:-Start Function ERROR_EXIT
20151221:22:22:31:gpinitsystem:digoal:postgres-[FATAL]:-Failed to complete obtain psql count Master gp_segment_configuration  Script Exiting!
20151221:22:22:31:015135 gpinitsystem:digoal:postgres-[WARN]:-Script has left Greenplum Database in an incomplete state
20151221:22:22:31:015135 gpinitsystem:digoal:postgres-[WARN]:-Run command /bin/bash /home/postgres/gpAdminLogs/backout_gpinitsystem_postgres_20151221_222157 to remove these changes
20151221:22:22:31:015135 gpinitsystem:digoal:postgres-[INFO]:-Start Function BACKOUT_COMMAND
20151221:22:22:31:015135 gpinitsystem:digoal:postgres-[INFO]:-End Function BACKOUT_COMMAND

code in bin/gpinitsystem

                U_DB=$DEFAULTDB
                CHK_COUNT=`env PGOPTIONS="-c gp_session_role=utility" $PSQL -p $MASTER_PORT -d "$U_DB" -A -t -c "SELECT count(*) FROM $GP_CONFIG_TBL WHERE content=${U_CONTENT} AND preferred_role='${U_ROLE}';" 2>$LOG_FILE` >> $LOG_FILE 2>&1
                ERROR_CHK $? "obtain psql count Master $GP_CONFIG_TBL" 2
                if [ $CHK_COUNT -eq 0 ]; then
                                LOG_MSG "[INFO]:-Adding $U_CONTENT on $U_HOSTNAME $U_DIR to system configuration table"
                                env PGOPTIONS="-c gp_session_role=utility" $PSQL -p $MASTER_PORT -d "$U_DB" -c "INSERT INTO $GP_CONFIG_TBL (dbid, content, role, preferred_role, mode, status, hostname, address, port, replication_port) VALUES (${U_DBID}, ${U_CONTENT}, '${U_ROLE}', '${U_ROLE}', 's', 'u', '${U_HOSTNAME}', '${U_ADDRESS}', ${U_PORT}, ${U_REPLICATION_PORT});" >> $LOG_FILE 2>&1
                                ERROR_CHK $? "add $U_CONTENT on $U_HOSTNAME to Master gp_segment_configuration" 2

解决方法:

Later versions of systemd will clear out semaphores on user logout by default, which can interfere with gpinitsystem.

Our solution to get Greenplum to install on CentOS 7.2 is to run the following as root before running gpinitsystem:

echo "RemoveIPC=no" >> /etc/systemd/logind.conf
service systemd-logind restart

Flag Counter

Viewing all articles
Browse latest Browse all 253

Trending Articles