Greenplum错误:未能获得一个或多个细分市场的资源

时间:2017-12-28 03:14:29

标签: python centos7 psql greenplum

在Centos7 greenplum 5.3版本上,我可以使用gpstart和createtb命令 但如果我使用如下,则会发生错误。

testdb=# select * FROM test_vb;
ERROR:  failed to acquire resources on one or more segments
DETAIL:  FATAL:  database "testdb" does not exist
 (seg3 xxx.xxx.xxx:xxx:40003)
testdb=#  failed to acquire resources on one or more segments
testdb-# ERROR:  failed to acquire resources on one or more segments

如果在其他数据库上运行相同的命令,它将挂起。 我将所有允许ip设置为" trust"

gpcheck -f hostfile_gpcheck -m mdw  

有这样的错误,因为mount -a和mount -o remount命令不会挂载 并且与磁盘的当前参数不同

 gpcheck:xxx:gpadmin-[ERROR]:-GPCHECK_ERROR host(xxx07.novalocal): XFS filesystem on device /dev/vda1 is missing the recommended mount option 'allocsize=16m'
 gpcheck:xxx:gpadmin-[ERROR]:-GPCHECK_ERROR host(xxx07.novalocal): XFS filesystem on device /dev/vda1 is missing the recommended mount option 'nobarrier'
 gpcheck:xxx:gpadmin-[ERROR]:-GPCHECK_ERROR host(xxx07.novalocal): XFS filesystem on device /dev/vda1 is missing the recommended mount option 'nodev'
 gpcheck:xxx:gpadmin-[ERROR]:-GPCHECK_ERROR host(xxx07.novalocal): XFS filesystem on device /dev/vdb has 8 XFS mount options and 6 are expected
 gpcheck:xxx:gpadmin-[ERROR]:-GPCHECK_ERROR host(xxx07.novalocal): XFS filesystem on device /dev/vdb is missing the recommended mount option 'allocsize=16m'

运行以下命令后,将使用empty和subnet2创建subnet1.out 没有创建。

 gpcheckperf -f hostfile_gpchecknet_ic1 -r N -d /tmp > subnet1.out
 gpcheckperf -f hostfile_gpchecknet_ic2 -r N -d /tmp > subnet2.out

以下命令可以成功运行

gpcheckperf -f hostfile_gpcheckperf -r ds -D \
  -d /data/primary -d  /data/primary \
  -d /data/mirror -d  /data/mirror

以下命令失败

gpadmin@xxxx ~]$ gpconfig -s max_connections
20171228:11:01:17:004149 gpconfig:xxxx:gpadmin-[ERROR]:-Failed to retrieve GUC information: error 'can't start transaction' in 'BEGIN'
'NoneType' object is not iterable

带有gplogfilter的日志文件如下(p.s.xxx.xxx.xxx.52是本地地址)

2017-12-28 11:04:43.288191 CST|gpadmin|testdb|p4178|th1396066176|xxx.xxx.xxx.52|40523|2017-12-28 11:04:25 CST|0|con31||seg-1||dx27||sx1|LOG: |00000|The previous session was reset because its gang was disconnected (session id = 30). The new session id = 31||||||INSERT INTO test_Vb (ID,name) VALUES (32, 'California');|0||cdbgang.c|1594|
2017-12-28 11:04:43.288263 CST|gpadmin|testdb|p4178|th1396066176|xxx.xxx.xxx.52|40523|2017-12-28 11:04:25 CST|0|con31||seg-1||dx27||sx1|ERROR: |58M01|failed to acquire resources on one or more segments|FATAL:  database "testdb" does not exist
 (seg5 xxx.xxx.xxx.66:40005)|||||INSERT INTO test_Vb (ID,name) VALUES (32, 'California');|0||cdbgang_async.c|200|
2017-12-28 11:04:43.288327 CST|gpadmin|testdb|p4178|th1396066176|xxx.xxx.xxx.52|40523|2017-12-28 11:04:25 CST|0|con31||seg-1||dx27||sx1|LOG: |00000|An exception was encountered during the execution of statement: INSERT INTO test_Vb (ID,name) VALUES (32, 'California');|||||||0||||
2017-12-28 11:05:55.593715 CST|gpadmin|testdb|p4191|th1396066176|xxx.xxx.xxx.52|40561|2017-12-28 11:05:55 CST|0|con32|cmd1|seg-1||dx28||sx1|LOG: |00000|statement: BEGIN||||||BEGIN|0||postgres.c|1629|
2017-12-28 11:05:55.601775 CST|gpadmin|testdb|p4191|th1396066176|xxx.xxx.xxx.52|40561|2017-12-28 11:05:55 CST|0|con33||seg-1||dx28||sx1|LOG: |00000|The previous session was reset because its gang was disconnected (session id = 32). The new session id = 33||||||BEGIN|0||cdbgang.c|1594|
2017-12-28 11:05:55.601805 CST|gpadmin|testdb|p4191|th1396066176|xxx.xxx.xxx.52|40561|2017-12-28 11:05:55 CST|0|con33||seg-1||dx28||sx1|ERROR: |58M01|failed to acquire resources on one or more segments|FATAL:  database "testdb" does not exist
 (seg0 xxx.xxx.xxx.66:40000)|||||BEGIN|0||cdbgang_async.c|200|
2017-12-28 11:05:55.601824 CST|gpadmin|testdb|p4191|th1396066176|xxx.xxx.xxx.52|40561|2017-12-28 11:05:55 CST|0|con33||seg-1||dx28||sx1|LOG: |00000|An exception was encountered during the execution of statement: BEGIN|||||||0||||
       in:     153 lines; timestamps from 2017-12-28 10:02:42.632585 to 2017-12-28 11:05:55.601824
      out:     153 lines; timestamps from 2017-12-28 10:02:42.632585 to 2017-12-28 11:05:55.601824
----------  /data/master/gpseg-1/pg_log/gp_era ----------
# Greenplum Database era.
# Do not change the contents of this file.
era = 582b5ab4de8c69e9_171228100237
       in:       3 lines; no timestamps found
      out:       3 lines

ssh命令可以使用gpadmin用户

在整个master和segment上工作

以下是gpstate

的结果
20171228:11:44:27:004381 gpstate:xxx05:gpadmin-[INFO]:-----------------------------------------------------                                                                                                                  
[gpadmin@tp-gpdb-ku05 ~]$ gpstatexxx
20171228:11:45:29:004462 gpstate:xxx05:gpadmin-[INFO]:-Starting gpstate with args:
20171228:11:45:30:004462 gpstate:xxx05:gpadmin-[INFO]:-local Greenplum Version: 'postgres (Greenplum Database) 5.3.0 build commit:2155c5a8cf8bb7f13f49c6e248fd967a74fed591'
20171228:11:45:30:004462 gpstate:xxx05:gpadmin-[INFO]:-master Greenplum Version: 'PostgreSQL 8.3.23 (Greenplum Database 5.3.0 build commit:2155c5a8cf8bb7f13f49c6e248fd967a74fed591) on x86_64-pc-linux-gnu, compiled by GCC gcc (GCC)
 6.2.0, 64-bit compiled on Dec  5 2017 19:10:20'
20171228:11:45:30:004462 gpstate:xxx05:gpadmin-[INFO]:-Obtaining Segment details from master...
20171228:11:45:30:004462 gpstate:xxx05:gpadmin-[INFO]:-Gathering data from segments...
20171228:11:45:32:004462 gpstate:xxx05:gpadmin-[INFO]:-Greenplum instance status summary
20171228:11:45:32:004462 gpstate:xxx05:gpadmin-[INFO]:-----------------------------------------------------
20171228:11:45:32:004462 gpstate:xxx05:gpadmin-[INFO]:-   Master instance                                = Active
20171228:11:45:32:004462 gpstate:xxx05:gpadmin-[INFO]:-   Master standby                                 = No master standby configured
20171228:11:45:32:004462 gpstate:xxx05:gpadmin-[INFO]:-   Total segment instance count from metadata     = 18
20171228:11:45:32:004462 gpstate:xxx05:gpadmin-[INFO]:-----------------------------------------------------
20171228:11:45:32:004462 gpstate:xxx05:gpadmin-[INFO]:-   Primary Segment Status
20171228:11:45:32:004462 gpstate:xxx05:gpadmin-[INFO]:-----------------------------------------------------
20171228:11:45:32:004462 gpstate:xxx05:gpadmin-[INFO]:-   Total primary segments                         = 18
20171228:11:45:32:004462 gpstate:xxx05:gpadmin-[INFO]:-   Total primary segment valid (at master)        = 18
20171228:11:45:32:004462 gpstate:xxx05:gpadmin-[INFO]:-   Total primary segment failures (at master)     = 0
20171228:11:45:32:004462 gpstate:xxx05:gpadmin-[INFO]:-   Total number of postmaster.pid files missing   = 0
20171228:11:45:32:004462 gpstate:xxx05:gpadmin-[INFO]:-   Total number of postmaster.pid files found     = 18
20171228:11:45:32:004462 gpstate:xxx05:gpadmin-[INFO]:-   Total number of postmaster.pid PIDs missing    = 0
20171228:11:45:32:004462 gpstate:xxx05:gpadmin-[INFO]:-   Total number of postmaster.pid PIDs found      = 18
20171228:11:45:32:004462 gpstate:xxx05:gpadmin-[INFO]:-   Total number of /tmp lock files missing        = 0
20171228:11:45:32:004462 gpstate:xxx05:gpadmin-[INFO]:-   Total number of /tmp lock files found          = 18
20171228:11:45:32:004462 gpstate:xxx05:gpadmin-[INFO]:-   Total number postmaster processes missing      = 0
20171228:11:45:32:004462 gpstate:xxx05:gpadmin-[INFO]:-   Total number postmaster processes found        = 18
20171228:11:45:32:004462 gpstate:xxx05:gpadmin-[INFO]:-----------------------------------------------------
20171228:11:45:32:004462 gpstate:xxx05:gpadmin-[INFO]:-   Mirror Segment Status
20171228:11:45:32:004462 gpstate:xxx05:gpadmin-[INFO]:-----------------------------------------------------
20171228:11:45:32:004462 gpstate:xxx05:gpadmin-[INFO]:-   Mirrors not configured on this array
20171228:11:45:32:004462 gpstate:xxx05:gpadmin-[INFO]:-----------------------------------------------------

当我尝试运行gpaddmirrors -p 10000时获取错误:

20171228:12:27:40:005190 gpaddmirrors:tp-gpdb-ku05:gpadmin-[INFO]:-Starting gpaddmirrors with args: -p 10000
20171228:12:27:41:005190 gpaddmirrors:tp-gpdb-ku05:gpadmin-[INFO]:-local Greenplum Version: 'postgres (Greenplum Database) 5.3.0 build commit:2155c5a8cf8bb7f13f49c6e248fd967a74fed591'
20171228:12:27:41:005190 gpaddmirrors:tp-gpdb-ku05:gpadmin-[INFO]:-master Greenplum Version: 'PostgreSQL 8.3.23 (Greenplum Database 5.3.0 build commit:2155c5a8cf8bb7f13f49c6e248fd967a74fed591) on x86_64-pc-linux-gnu, compiled by GCC gcc
(GCC) 6.2.0, 64-bit compiled on Dec  5 2017 19:10:20'
20171228:12:27:41:005190 gpaddmirrors:tp-gpdb-ku05:gpadmin-[INFO]:-Obtaining Segment details from master...
20171228:12:27:41:005190 gpaddmirrors:tp-gpdb-ku05:gpadmin-[ERROR]:-[Errno 12] Cannot allocate memory
Traceback (most recent call last):
  File "/usr/local/greenplum-db/lib/python/gppylib/commands/base.py", line 243, in run
    self.cmd.run()
  File "/usr/local/greenplum-db/lib/python/gppylib/commands/base.py", line 711, in run
    self.exec_context.execute(self)
  File "/usr/local/greenplum-db/lib/python/gppylib/commands/base.py", line 655, in execute
    LocalExecutionContext.execute(self, cmd)
  File "/usr/local/greenplum-db/lib/python/gppylib/commands/base.py", line 433, in execute
    stdout=subprocess.PIPE, close_fds=True)
  File "/usr/local/greenplum-db/ext/python/lib/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/local/greenplum-db/ext/python/lib/python2.7/subprocess.py", line 1235, in _execute_child
    self.pid = os.fork()
OSError: [Errno 12] Cannot allocate memory
20171228:12:27:42:005190 gpaddmirrors:xxx05:gpadmin-[WARNING]:-cannot access pg_controldata for dbid 21 on host xxx7.novalocal
20171228:12:27:42:005190 gpaddmirrors:xxx05:gpadmin-[WARNING]:-cannot access pg_controldata for dbid 23 on host xxx7.novalocal
20171228:12:27:42:005190 gpaddmirrors:xxx05:gpadmin-[WARNING]:-cannot access pg_controldata for dbid 20 on host xxx7.novalocal
20171228:12:27:42:005190 gpaddmirrors:xxx05:gpadmin-[WARNING]:-cannot access pg_controldata for dbid 22 on host xxx7.novalocal
20171228:12:27:42:005190 gpaddmirrors:xxx05:gpadmin-[WARNING]:-cannot access pg_controldata for dbid 24 on host xxx7.novalocal
20171228:12:27:42:005190 gpaddmirrors:xxx05:gpadmin-[WARNING]:-cannot access pg_controldata for dbid 25 on host xxx7.novalocal
20171228:12:27:42:005190 gpaddmirrors:xxx05:gpadmin-[WARNING]:-cannot access pg_controldata for dbid 27 on host xxx8.novalocal
20171228:12:27:42:005190 gpaddmirrors:xxx05:gpadmin-[WARNING]:-cannot access pg_controldata for dbid 32 on host xxx6.novalocal
20171228:12:27:42:005190 gpaddmirrors:xxx05:gpadmin-[WARNING]:-cannot access pg_controldata for dbid 26 on host xxx8.novalocal
20171228:12:27:42:005190 gpaddmirrors:xxx05:gpadmin-[WARNING]:-cannot access pg_controldata for dbid 28 on host xxx8.novalocal
20171228:12:27:42:005190 gpaddmirrors:xxx05:gpadmin-[WARNING]:-cannot access pg_controldata for dbid 33 on host xxx6.novalocal
20171228:12:27:42:005190 gpaddmirrors:xxx05:gpadmin-[WARNING]:-cannot access pg_controldata for dbid 31 on host xxx8.novalocal
20171228:12:27:42:005190 gpaddmirrors:xxx05:gpadmin-[WARNING]:-cannot access pg_controldata for dbid 34 on host xxx6.novalocal
20171228:12:27:42:005190 gpaddmirrors:xxx05:gpadmin-[WARNING]:-cannot access pg_controldata for dbid 35 on host xxx6.novalocal
20171228:12:27:42:005190 gpaddmirrors:xxx05:gpadmin-[WARNING]:-cannot access pg_controldata for dbid 29 on host xxx8.novalocal
20171228:12:27:42:005190 gpaddmirrors:xxx05:gpadmin-[WARNING]:-cannot access pg_controldata for dbid 30 on host xxx8.novalocal
20171228:12:27:42:005190 gpaddmirrors:xxx05:gpadmin-[CRITICAL]:-gpaddmirrors failed. (Reason=''NoneType' object has no attribute 'rc'') exiting...

镜像创建失败后,我运行gpstop和gpstart,得到这些错误

20171228:13:31:21:010253 gpstart:xxx05:gpadmin-[ERROR]:-[Errno 12] Cannot allocate memory
Traceback (most recent call last):
  File "/usr/local/greenplum-db/lib/python/gppylib/commands/base.py", line 243, in run
    self.cmd.run()
  File "/usr/local/greenplum-db/lib/python/gppylib/commands/base.py", line 711, in run
    self.exec_context.execute(self)
  File "/usr/local/greenplum-db/lib/python/gppylib/commands/base.py", line 655, in execute
    LocalExecutionContext.execute(self, cmd)
  File "/usr/local/greenplum-db/lib/python/gppylib/commands/base.py", line 433, in execute
    stdout=subprocess.PIPE, close_fds=True)
  File "/usr/local/greenplum-db/ext/python/lib/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/local/greenplum-db/ext/python/lib/python2.7/subprocess.py", line 1235, in _execute_child
    self.pid = os.fork()
OSError: [Errno 12] Cannot allocate memory
20171228:13:31:22:010253 gpstart:xxx05:gpadmin-[CRITICAL]:-gpstart failed. (Reason=''NoneType' object has no attribute 'rc'') exiting...

1 个答案:

答案 0 :(得分:0)

我认为错误与以下问题相同,尽管有不同的错误消息。 greenplum hang forever when doing any search or insert actions with psql and centos7