greenplum - Add Mirror of segment

구성 생성
gpaddmirrors -o /usr/local/greenplum-db/gpmirrors_config

생성 프로파일 보기
vim gpmirrors_config
0|chen-es02|7000|/data/greenplum/data1/mirror/gpseg0
1|chen-es02|7001|/data/greenplum/data1/mirror/gpseg1
2|chen-es02|7002|/data/greenplum/data2/mirror/gpseg2
3|chen-es02|7003|/data/greenplum/data2/mirror/gpseg3
4|chen-es03|7000|/data/greenplum/data1/mirror/gpseg4
5|chen-es03|7001|/data/greenplum/data1/mirror/gpseg5
6|chen-es03|7002|/data/greenplum/data2/mirror/gpseg6
7|chen-es03|7003|/data/greenplum/data2/mirror/gpseg7
8|chen-es01|7000|/data/greenplum/data1/mirror/gpseg8
9|chen-es01|7001|/data/greenplum/data1/mirror/gpseg9
10|chen-es01|7002|/data/greenplum/data2/mirror/gpseg10
11|chen-es01|7003|/data/greenplum/data2/mirror/gpseg11

폴더가 비어 있는지 확인합니다.
gpssh -f /usr/local/greenplum-db/all_hosts -e 'rm -rf /data/greenplum/data1/mirror/*'
gpssh -f /usr/local/greenplum-db/all_hosts -e 'rm -rf /data/greenplum/data2/mirror/*'

mirror 생성
gpaddmirrors -i gpmirrors_config

상태 보기
 gpstate -m
20200623:15:28:47:023871 gpstate:chen-es01:gpadmin-[INFO]:-Starting gpstate with args: -m
20200623:15:28:47:023871 gpstate:chen-es01:gpadmin-[INFO]:-local Greenplum Version: 'postgres (Greenplum Database) 6.8.1 build commit:7118e8aca825b743dd9477d19406fcc06fa53852'
20200623:15:28:47:023871 gpstate:chen-es01:gpadmin-[INFO]:-master Greenplum Version: 'PostgreSQL 9.4.24 (Greenplum Database 6.8.1 build commit:7118e8aca825b743dd9477d19406fcc06fa53852) on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 6.4.0, 64-bit compiled on Jun 11 2020 16:37:46'
20200623:15:28:47:023871 gpstate:chen-es01:gpadmin-[INFO]:-Obtaining Segment details from master...
20200623:15:28:47:023871 gpstate:chen-es01:gpadmin-[INFO]:--------------------------------------------------------------
20200623:15:28:47:023871 gpstate:chen-es01:gpadmin-[INFO]:--Current GPDB mirror list and status
20200623:15:28:47:023871 gpstate:chen-es01:gpadmin-[INFO]:--Type = Group
20200623:15:28:47:023871 gpstate:chen-es01:gpadmin-[INFO]:--------------------------------------------------------------
20200623:15:28:47:023871 gpstate:chen-es01:gpadmin-[INFO]:-   Mirror      Datadir                                Port   Status    Data Status
20200623:15:28:47:023871 gpstate:chen-es01:gpadmin-[INFO]:-   chen-es02   /data/greenplum/data1/mirror/gpseg0    7000   Passive   Synchronized
20200623:15:28:47:023871 gpstate:chen-es01:gpadmin-[INFO]:-   chen-es02   /data/greenplum/data1/mirror/gpseg1    7001   Passive   Synchronized
20200623:15:28:47:023871 gpstate:chen-es01:gpadmin-[INFO]:-   chen-es02   /data/greenplum/data2/mirror/gpseg2    7002   Passive   Synchronized
20200623:15:28:47:023871 gpstate:chen-es01:gpadmin-[INFO]:-   chen-es02   /data/greenplum/data2/mirror/gpseg3    7003   Passive   Synchronized
20200623:15:28:47:023871 gpstate:chen-es01:gpadmin-[INFO]:-   chen-es03   /data/greenplum/data1/mirror/gpseg4    7000   Passive   Synchronized
20200623:15:28:47:023871 gpstate:chen-es01:gpadmin-[INFO]:-   chen-es03   /data/greenplum/data1/mirror/gpseg5    7001   Passive   Synchronized
20200623:15:28:47:023871 gpstate:chen-es01:gpadmin-[INFO]:-   chen-es03   /data/greenplum/data2/mirror/gpseg6    7002   Passive   Synchronized
20200623:15:28:47:023871 gpstate:chen-es01:gpadmin-[INFO]:-   chen-es03   /data/greenplum/data2/mirror/gpseg7    7003   Passive   Synchronized
20200623:15:28:47:023871 gpstate:chen-es01:gpadmin-[INFO]:-   chen-es01   /data/greenplum/data1/mirror/gpseg8    7000   Passive   Synchronized
20200623:15:28:47:023871 gpstate:chen-es01:gpadmin-[INFO]:-   chen-es01   /data/greenplum/data1/mirror/gpseg9    7001   Passive   Synchronized
20200623:15:28:47:023871 gpstate:chen-es01:gpadmin-[INFO]:-   chen-es01   /data/greenplum/data2/mirror/gpseg10   7002   Passive   Synchronized
20200623:15:28:47:023871 gpstate:chen-es01:gpadmin-[INFO]:-   chen-es01   /data/greenplum/data2/mirror/gpseg11   7003   Passive   Synchronized
20200623:15:28:47:023871 gpstate:chen-es01:gpadmin-[INFO]:--------------------------------------------------------------

오류가 있으면/home/gpadmin/gpAdminLogs 디렉터리에서 오류 로그를 볼 수 있습니다.

좋은 웹페이지 즐겨찾기