首先是查询等操作无法完成,一只没有反应,等待时间超长后gp会崩溃

[gpadmin@greenplum gpconfig]$ psql postgres gpadmin

select * from test;

100608963.jpg

2013-10-23 11:34:06.747775 CST,"gpadmin","postgres",p29544,th-1750079744,"[local]",,2013-10-23 11:05:23 CST,1426,con30,cmd24,seg-1,,dx100,x1426,sx1,"LOG","00000","statement: select * from test;",,,,,,"select * from test;",0,,"postgres.c",1535,

日志也无从下手


重启gp等都不可以,后来采取极端做饭,重新初始化GP,重启,还是不行

首先初始化的时候要停止端口5432和删除/data dpseg-1的内容

删除/tmp//tmp/.s.PGSQL.5432 和 /tmp/.s.PGSQL.5432.lock


20131023:18:38:39:016109 gpinitsystem:greenplum:gpadmin-[INFO]:-Checking Master host

20131023:18:38:39:016109 gpinitsystem:greenplum:gpadmin-[WARN]:-No lock file /tmp/.s.PGSQL.5432.lock but process running on port 5432

20131023:18:38:39:gpinitsystem:greenplum:gpadmin-[FATAL]:-Found indication of postmaster process on port 5432 on Master host Script Exiting!

[gpadmin@greenplum gpconfig]$ lsof -i:5432

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME

postgres 10738 gpadmin 3u IPv4 264510 0t0 TCP *:postgres (LISTEN)

postgres 10738 gpadmin 4u IPv6 264511 0t0 TCP *:postgres (LISTEN)

[gpadmin@greenplum gpconfig]$ kill -9 10738


后来初始化不知道怎么回事,重启报了一个错,这个错误信息很重要


20131023:18:41:13:031907 gpstart:greenplum:gpadmin-[INFO]:-Command pg_ctl reports Master greenplum instance active

20131023:18:41:13:031907 gpstart:greenplum:gpadmin-[WARNING]:-FATAL: DTM initialization: failure during startup/recovery, retry failed, check segment status (cdbtm.c:1351)


20131023:18:41:13:031907 gpstart:greenplum:gpadmin-[INFO]:-Check status of database with gpstate utility

20131023:18:41:13:021367 gpinitsystem:greenplum:gpadmin-[INFO]:-Completed restart of Greenplum instance in production mode

20131023:18:41:13:021367 gpinitsystem:greenplum:gpadmin-[INFO]:-Loading gp_toolkit...

psql: FATAL: DTM initialization: failure during startup/recovery, retry failed, check segment status (cdbtm.c:1351)

20131023:18:41:13:gpinitsystem:greenplum:gpadmin-[FATAL]:-Failed to retrieve rolname. Script Exiting!


原来是iptables没有关闭


首先stop iptables

[gpadmin@greenplum gpconfig]$ sudo service iptables stop

然后

[gpadmin@greenplum gpconfig]$ gpstop -u

20131024:10:00:00:017083 gpstart:greenplum:gpadmin-[INFO]:-Process results...

20131024:10:00:00:017083 gpstart:greenplum:gpadmin-[INFO]:-----------------------------------------------------

20131024:10:00:00:017083 gpstart:greenplum:gpadmin-[INFO]:- Successful segment starts = 2

20131024:10:00:00:017083 gpstart:greenplum:gpadmin-[INFO]:- Failed segment starts = 0

20131024:10:00:00:017083 gpstart:greenplum:gpadmin-[INFO]:- Skipped segment starts (segments are marked down in configuration) = 0

20131024:10:00:00:017083 gpstart:greenplum:gpadmin-[INFO]:-----------------------------------------------------

20131024:10:00:00:017083 gpstart:greenplum:gpadmin-[INFO]:-

20131024:10:00:00:017083 gpstart:greenplum:gpadmin-[INFO]:-Successfully started 2 of 2 segment instances

20131024:10:00:00:017083 gpstart:greenplum:gpadmin-[INFO]:-----------------------------------------------------

20131024:10:00:00:017083 gpstart:greenplum:gpadmin-[INFO]:-Starting Master instance greenplum directory /data/master_database/gpseg-1

20131024:10:00:01:017083 gpstart:greenplum:gpadmin-[INFO]:-Command pg_ctl reports Master greenplum instance active

20131024:10:00:01:017083 gpstart:greenplum:gpadmin-[INFO]:-Database successfully started


后来一切OK

gpadmin_db=# select * from test;

id | name

----+------

(0 rows)


gpadmin_db=# INSERT INTO test (id,name) VALUES (1,a);

ERROR: column "a" does not exist

LINE 1: INSERT INTO test (id,name) VALUES (1,a);

^

gpadmin_db=# INSERT INTO test (id,name) VALUES (1,'a');

INSERT 0 1

gpadmin_db=# select * from test ;

id | name

----+------

1 | a

(1 row)