2017년 9월 21일 목요일

GPDB 장애대응 - gpstart 실패

1. GPDB - gpstart 실패 시 확인 사항

    1) pg_hba.conf 파일 수정 여부
        -  ip 등록시 class 적용하지 않았을 경우
        - ex ) 0.0.0.0 으로 등록 할 경우 장애 발생 => 0.0.0.0/0 으로 등록

$ cd $MASTER_DATA_DIRECTORY
$ vi pg_hba.conf
# TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD
# Type : local : 마스터 노드에서 접속, host : IP로 접속
# Database : all 은 모든 데이터베이스 접속 허용, 특정 db만 접근할 경우 database 명 기입.
# user : all / user명
# CIDR-ADDRESS: IP/0 : 전부 허용,  IP/8: A class 허용, IP/16 B Class 허용
#                       IP/24 C Class 허용, IP/32 IP 일치시 허용
# METHOD : md5 : 비밀번호 필요, trust : 비밀번호 필요치 않음(비밀번호가 틀리더라도 접속 가능 함)
# 예제
local   all   gpadmin      trust
host    all   all  172.16.0.0/16   md5  # 172.16.X.X B class, 패스워드 필요
host    bmt   all  192.168.10.0/28 trust# bmt DB에 모든 user가 192.168.10.X C class로
                                        # 패스워드 없이 접속 가능함
host    bmt   u1234 192.168.10.101/32  md5 # bmt 데이터 베이스에 u1234 / 해당IP에 대해서 
                                   # 패스워드가 일치해야지만 접속할 수 있음

host    bmt   u1234 192.168.10.101     md5  ###==> 장애 유발 "/" Class 지정되어 있지 않음.  


   2) postgresql.conf 파일 잘 못 적용된 경우
        - 파라미터의 값이 잘 못 저장되었거나, value 임계치 보다 높을 경우 발생
        - 예시
$ cd $MASTER_DATA_DIRECTORY
$ vi postgresql.conf
gp_resqueue_memory_policy=eager_freea   ## value 에러 발생 eager_free 으로 등록해야 함.

 
    3) Log 파일 확인
        - tail -f gpdb-yyyy-mm-dd-xxxxxx.csv
        - tail -f startup.log
$ cd $MASTER_DATA_DIRECTORY
$ cd pg_log
[gpadmin@mdw pg_log]$ tail -f gpdb-2017-09-19_061729.csv

2017-09-19 06:17:29.802815 KST,,,p65274,th708482848,,,,0,,,seg-1,,,,,"LOG","F0000","invalid IP mask ""md5"": Name or service not known",,,,,"line 88 of configuration file ""/data/master/xpseg-1/pg_hba.conf""",,0,,"hba.c",992,
2017-09-19 06:17:29.802913 KST,,,p65274,th708482848,,,,0,,,seg-1,,,,,"FATAL","F0000","could not load pg_hba.conf",,,,,,,0,,"postmaster.c",1509,
^C
[gpadmin@mdw pg_log]$ tail -f startup.log

2. GPDB - 특정 세그먼트가 startup 되어서 대기하는 경우 
     1) GPDB 4.3. old 버전에서 발생되었으나, 현재 Fix 되었음.
     2) 프로세스 확인 (마스터 및 세그먼트 노드)


mdw $ps -ef | grep start | grep StrictHostKeyChecking --프로세스가 있을경우 startup 되지 않음.
sdwx$ps -ef | grep primarymirror -- 세그먼트가 아직 startup 되지 않음을 의미 
    
    3) 세그먼트 노드에서 확인

sdwx $ ps -ef | grep primarymirror 
gpadmin  791028 790943  0 05:40 ?        00:00:00 /usr/local/greenplum-db/./bin/gp_primarymirror -h localhost -p 1028 -i /data1/primary/gpseg19/gp_pmtransition_args
* Check the tail of the segment logs to confirm that it is waiting on file transfer from primary to mirror:

## sdw x segment db log 
2016-03-15 16:03:26.104678 UTC,,,p467438,th1170523936,,,,0,,,seg-1,,,,,"LOG","00000","recovering pg_distributedlog",,,,,,,0,,"slru.c",1363,
2016-03-15 16:04:12.826187 UTC,,,p467362,th1170523936,,,,0,,,seg-1,,,,,"LOG","00000","TransitiontoPrimary: waiting for filerep startup",,,,,,,0,,"primary_mirror_mode.c",2058,
2016-03-15 16:05:03.116920 UTC,,,p467362,th1170523936,,,,0,,,seg-1,,,,,"LOG","00000","TransitiontoPrimary: waiting for filerep startup",,,,,,,0,,"primary_mirror_mode.c",2058

## 세그먼트 Primary process 확인 
gpadmin  595121      1  0 16:15 ?        00:00:00 /usr/local/GP-4.3.7.1/bin/postgres -D /data1/primary/gpseg1064 -p 1025 -b 2122 -z 1152 --silent-mode=true -i -M quiescent -C 1064
gpadmin  595129 595121  0 16:15 ?        00:00:00 postgres: port  1025, logger process                               
gpadmin  595156 595055  0 16:15 ?        00:00:00 /usr/local/greenplum-db/./bin/gp_primarymirror -h localhost -p 1025 -i /data1/primary/gpseg1064/gp_pmtransition_args
gpadmin  595158 595121  0 16:15 ?        00:00:00 postgres: port  1025, filerep transition process                               
gpadmin  595160 595121  0 16:15 ?        00:00:00 postgres: port  1025, primary process  
gpadmin  595164 595160  0 16:15 ?        00:00:00 postgres: port  1025, primary receiver ack process                               
gpadmin  595166 595160  0 16:15 ?        00:00:00 postgres: port  1025, primary sender process                               
gpadmin  595168 595160  0 16:15 ?        00:00:00 postgres: port  1025, primary consumer ack process                               
gpadmin  595169 595160  0 16:15 ?        00:00:00 postgres: port  1025, primary recovery process                               
gpadmin  595170 595160  0 16:15 ?        00:00:00 postgres: port  1025, primary verification process                               
gpadmin  595329 595273  0 16:23 pts/2    00:00:00 grep 1025 
* Issue a kill -11 on the primary process to reset it. Please be careful to not issue it on postmaster, that would cause the segment to fail.

    4) 해당 포트 이슈 프로세스 Kill

       sdwX $ kill -11  595160


    5) 정상적으로 Database startup 수행 됨.
         - 만약 여러개의 프로세스가 걸릴 경우에는 동일한 패턴으로 처리
         - gpdb 4.3.10.0 이상 버전에서는 Fix 됨.




댓글 없음:

댓글 쓰기

Greenplum Backup & Restore

Greenplum에서는 gpbackup과 gprestore를 이용해서 대량의 데이터를 병렬로 백업/병렬로 복구를 지원하고 있습니다. Full 백업이외에도 incremental 백업을 지원하고 있습니다.  - incremental 백업시에는 반드시 사전...