PostgreSQL
-
audit 제품 비교PostgreSQL 2019. 11. 8. 14:44
개요 PostgreSQL에서 사용되고 있는 audit 제품을 조사하고 비교한다. audit audit은 데이터베이스에서 발생하는 이벤트를 추적 및 기록한다. 비교 제품은 cyanAudit, pgAudit, pgMemento이다. 비교 제품 유지보수가 가능한지 등을 확인하기 위해 비교할 제품에 대해 몇 가지 확인한다. cyanAudit pgAudit pgMemento 회사/커뮤니티 커뮤니티 Crunchy Data 커뮤니티 license PostgreSQL License PostgreSQL License LGPL-3.0 first release 12년 15년 12월 16년 5월 last release 19년 4월, v2.2.1 18년 10월, v1.3.0 19년 3월, v0.6.1 contributors -..
-
PostgreSQL HA 도구 비교PostgreSQL 2019. 10. 14. 16:08
기능 비교 최소 서버 2대 구성 repmgr 문서: https://repmgr.org/docs/4.1/ 최소 서버 3대 구성 patroni 문서: https://patroni.readthedocs.io/en/latest/ stolon 문서: https://github.com/sorintlab/stolon/blob/master/doc/README.md 프로젝트 개요 repmgr patroni stolon 회사/커뮤니티 2ndQuadrant zalando sorint.oss github first release 10년 12월 v1.0.0 15년 10월 v0.4 15년 11월 v0.2.0 github last release 18년 7월 v4.1.0 18년 8월 v1.4.6 18년 7월 v0.12.0 githu..
-
stolon 설치PostgreSQL 2019. 10. 14. 16:04
stolon 시나리오(로컬 환경에서 2개의 agensgraph instance로 진행) etcd 설치 etcd 설치 확인 etcd 시작 stolon 실행 파일 다운로드 stolon 실행 파일 압축 풀기 stolon 실행 파일 확인 stolon 클러스터 초기화 stolon-sentinel 시작 stonlon-keeper 시작 - master stolon-proxy 시작 proxy를 통해 DB에 접속 stolon-keeper 시작 - standby stolon 구성 확인 자동 failover 테스트 자동 failover 테스트 확인 failback 테스트 failback 테스트 확인 다음은 stolon 시나리오를 실행한 명령어이다. //etcd 설치 [bylee@localhost ha]$ wget https..
-
patroni 설치PostgreSQL 2019. 10. 14. 16:03
patroni 시나리오(로컬 환경에서 2개의 agensgraph instance로 진행) etcd 설치 etcd 설치 확인 etcd 시작 patroni 설치 patroni 설치 확인 agensgraph 1 설정 파일 작성 patroni 명령어로 agensgraph 1 instance 실행 agensgraph 2 설정 파일 작성 patroni 명령어로 agensgraph 2 instance 실행 partronictl 명령어로 agensgraph instance 확인 failback 테스트 자동 failover 테스트 다음은 patroni 시나리오를 실행한 명령어이다. //etcd 설치 [bylee@localhost ha]$ wget https://github.com/etcd-io/etcd/releases/..
-
repmgr 설치PostgreSQL 2019. 10. 14. 16:02
repmgr 시나리오(로컬 환경에서 3개의 agensgraph instance로 진행) primary server의 postgresql.conf에 replication 설정 max_wal_senders = 10 wal_level = 'hot_standby' hot_standby = on archive_mode = on archive_command = '/bin/true' wal_log_hints = on repmgr 사용자와 metadata용 데이터베이스를 생성 $ createuser -s repmgr $ createdb repmgr -O repmgr pg_hba.conf 설정 local replication repmgr trust host replication repmgr 127.0.0.1/32 tru..
-
pgbouncer와 pgpool-II 비교PostgreSQL 2019. 10. 11. 14:09
프로젝트 상태 지속으로 유지보수가 가능한지 확인한다. pgbouncer pgpool-II 회사/커뮤니티 커뮤니티 SRA OSS, Inc. Japan 라이센스 ISC BSD first release 07년 3월, v1.0 06년 9월, v1.0.0 last release 18년 8월, v1.9.0 18년 10월, v4.0.1 contributors 33 8 github star 692 52 테스트된 OS linux, window linux PostgreSQL 지원 버전 >= 7.4 >= 6.4 기능비교 connection pooling에 대한 기능에 대해서만 비교한다. pgbouncer와 달리 pgpool-II는 connection pooling 기능 외에 failover 등과 같은 기능을 제공한다. 상세..
-
pgpool-II session failoverPostgreSQL 2019. 10. 11. 14:08
pgpool-II는 자동 session failover가 된다. 테스트 시나리오 agensgraph의 initdb 명령어로 data1을 생성한다. data1/postgresql.conf 파일을 수정하고, ag_ctl 명령어로 data1를 시작한다. pg_basebackup 명령어로 data2를 생성하고, ag_ctl 명령어로 data2를 시작한다. 백업대상은 data1이다. pgpool-II를 시작한다. agens 명령어에 pgpool-II port를 사용하여 질의한다. ag_ctl stop명령어로 master인 data1를 죽인다. agens 명령어에 pgpool-II port를 사용하여 질의한다. 다음은 위의 테스트 시나리오를 실행한 결과이다. data1/postgresql.conf 내용 # ----..
-
pgbouncer session failoverPostgreSQL 2019. 10. 11. 14:04
PgBouncer는 automatic session failover를 지원하지 않는다. session failover는 connection을 여러 개로 설정하며, 순차적으로 connection을 시도하여 connection 가능한 database에 접속한다. pgbouncer 공식 문서(https://pgbouncer.github.io/faq.html)에서 다음과 같이 언급하고 있다. How to failover PgBouncer does not have internal failover-host configuration nor detection. It is possible via some external tools: DNS reconfiguration - when ip behind DNS name is ..