IT Japan
슬레이브에서 마스터로 승격 본문
쓰기를 할수 없다고 보고되고 프로세스 모니터링되고이 사태를 파악하십시오. 복구 불능이라고 판단되면 node1을 버립니다. cron 항목을 삭제합니다. 새로운 기본이되는 서버 이외의 상시 대기 서버도 버립니다. 프로세스를 중지하고 crontab 항목을 끕니다. 새로운 기본이되는 node2에 트리거를 실행하여 node2를 기본으로합니다. crontab에서 node1에서 WAL 아카이브를 동기화하고 항목을 지우고 대신 이전 WAL 아카이브를 제거하기위한 항목과 물리적 백업 항목을 추가합니다. [첫번째 서버를 프라이머리화]와 동등으로 남겨둡니다.슬레이브에서 마스터로 승격
상시 대기가 실패하더라도 전항과 같이 간단하게 리플레이스 할 수 있습니다 만, 기본적으로 오류가 발생하면 귀찮습니다. 기본만으로도 DRBD되고 공유 디스크 나름으로 동기화 HA 화되면 좋을지도 모릅니다.
장애에 비유하여 프라이머리 (node1)의 프로세스를 떨어 뜨립니다.[root@node1 ~]# su - postgres
-bash-3.2$ /usr/pgsql-9.0/bin/pg_ctl -D /pgdata/ -m immediate stop
서버 정지 처리의 완료를 기다리고 있습니다 ... 완료 서버가 중지되었습니다
-bash-3.2$
-bash-3.2$ crontab -l
@reboot /usr/pgsql-9.0/bin/pg_ctl -D /pgdata/ start
0 5 * * * /usr/bin/tmpwatch 240 /backup/walarch/0 5 * * 0 /pgdata/backup-pgdata-bash-3.2$ crontab -e-bash-3.2$ crontab -l-bash-3.2$
[root@node3 ~]# su - postgres
-bash-3.2$ /usr/pgsql-9.0/bin/pg_ctl -D /pgdata/ stop
서버 정지 처리의 완료를 기다리고 있습니다 .... 완료 서버가 중지되었습니다
-bash-3.2$ crontab -l
0 * * * * rsync -azr --delete --rsh=ssh node1.priv:/backup/walarch/ /backup/walarch/@reboot /usr/pgsql-9.0/bin/pg_ctl -D /pgdata/ start-bash-3.2$ crontab -e-bash-3.2$ crontab -l-bash-3.2$[root@node2 ~]# su - postgres-bash-3.2$ touch /var/lib/pgsql/trigger-bash-3.2$ crontab -l0 * * * * rsync -azr --delete --rsh=ssh node1.priv:/backup/walarch/ /backup/walarch/@reboot /usr/pgsql-9.0/bin/pg_ctl -D /pgdata/ start-bash-3.2$ crontab -e-bash-3.2$ crontab -l@reboot /usr/pgsql-9.0/bin/pg_ctl -D /pgdata/ start0 5 * * * /usr/bin/tmpwatch 240 /backup/walarch/0 5 * * 0 /pgdata/backup-pgdata-bash-3.2$
[root@node1 ~]# passwd postgresChanging password for user postgres.N
'IT > PostgreSQL' 카테고리의 다른 글
백업 (0) | 2016.05.30 |
---|---|
Archive Log의 보존 방법 (0) | 2016.05.30 |
DB 작업 메모 (0) | 2016.05.30 |
Slave의 설정 및 reprication 동기화 (0) | 2016.05.30 |
DB 작업 메모 (0) | 2016.05.30 |