목록IT/PostgreSQL (23)
IT Japan
슬레이브에서 마스터로 승격상시 대기가 실패하더라도 전항과 같이 간단하게 리플레이스 할 수 있습니다 만, 기본적으로 오류가 발생하면 귀찮습니다. 기본만으로도 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$ 쓰기를 할수 없다고 보고되고 프로세스 모니터링되고이 사태를 파악하십시오. 복구 불능이라고 판단되면 node1을 버립니다. cron 항목을 삭제합니다.-..
[root@tmc_db02 local]# cd /usr/local [root@tmc_db02 local]# ls -la total 96 drwxr-xr-x 12 root root 4096 Mar 23 21:46 . drwxr-xr-x 14 root root 4096 Mar 23 21:47 .. drwxr-xr-x 2 root root 4096 Mar 11 2009 bin drwxr-xr-x 2 root root 4096 Mar 11 2009 etc drwxr-xr-x 2 root root 4096 Mar 11 2009 games drwxr-xr-x 2 root root 4096 Mar 11 2009 include drwxr-xr-x 2 root root 4096 Mar 11 2009 lib drwxr-x..
master의 설정 standby_mode = 'off'로 설정 #/usr/local/postgresql9/bin/psql -p 5432 -U interdev postgres=# select pg_start_backup('hwang'); pg_start_backup ----------------- 0/2000020 (1 row) postgres=# \q [root@tmc_db01 hwangtemp]# cd /data13 [root@tmc_db01 data13]# ls -la [root@tmc_db01 data13]# tar cvfz data.tar.gz data [root@tmc_db01 data13]# ls -la data.tar.gz [root@tmc_db01 data13]# scp data.tar...
(data 디렉토리를 삭제) /usr/local/postgresql/bin/initdb --pgdata=/usr/local/postgresql/data cp -p /usr/local/postgresql/conf/*.conf /usr/local/postgresql/data/ /etc/rc.d/init.d/gp_postgres start vi /usr/local/postgresql/data/postgresql.conf (아카이브 로그를 뱉지 않도록한다) (interdev) /usr/local/postgresql/bin/psql -h localhost -p 5432 -U postgres -l /usr/local/postgresql/bin/createuser -h localhost -p 5432 -a -d -U..
PostgreSQL9 복제 기능은 스트리밍 복제 및 상시 대기 기능을 결합한 제품이다. http://www.interdb.jp/techinfo/pg_sr/sr02.html http://www.interdb.jp/techinfo/pg_sr/sr01.html 본 문서에서는 마스터 1 대와 슬레이브 마스터 1 대 2 대 구성에서 복제 구성 예를 나타낸다. 또한,이 설정에 대한 검증은 프로덕션 환경으로는 의미가 없지만 Xen을 이용한 2 개의 가상 머신에서 테스트를 실시했다. 여기에서는 마스터 측의 컴퓨터의 IP 주소를 192.168.0.1 슬레이브 컴퓨터의 IP 주소를 192.168.0.2로 설명한다. 마스터 측 PostgreSQL9을 셋업 ①우선은 소스로부터 컴파일한다. wget ftp://ftp2.jp.p..
본 기사는 2014 년 PostgreSQL Advent Calendar의 12/17의 기사입니다. 2014 년 11 월 7 일에 출시 된 pgpool-II 3.4의 새로운 기능을 소개합니다.pgpool-II는 pgpool-II는 여러 PostgreSQL을 사용한 클러스터 시스템을 구축 할 수있는 미들웨어입니다. pgpool-II는 PostgreSQL 클라이언트와 여러 PostgreSQL 사이에 끼어 든 proxy처럼 작동합니다. 기존 PostgreSQL 애플리케이션을 거의 변경하지 않고 사용할 수 있습니다.가장 많은 pgpool-II의 용도는 PostgreSQL를 여러 대 사용하는 스트리밍 복제 구성에 의한 클러스터의 관리 서버로 사용하는 것입니다. 다음과 같은 기능을 사용할 수 있습니다.PostgreS..
PostgreSQL의 날짜 계산 오늘은 PostgreSQL로 날짜 계산입니다. PHP는 각 날짜 계산은 할 수 있지만 SQL에서 날짜 계산 수 있습니다. 우선 오늘 날짜에서 ... 이것은 간단하네요. now 함수 또는 current_timestamp 함수를 사용합니다. 여기에서는 가능한 ANSI 표준에 가고 싶어서 current_timestamp 함수 쪽를 사용합니다.select now () select current_timestamp now2009-06-19 03 : 06 : 34.756232 + 09 우선 ○ 일 전 ○ 일 이후의 날짜입니다. 내일 날짜는 이렇게 씁니다. select current_timestamp + '1 day' ? column?2009-06-20 03 : 07 : 34.75623..
PostgreSQL의 파라미터 튜닝을 해 보았다.스택 별표 - PostgreSQL 성능 튜닝All Aobut - PostgreSQL 튜닝ThinkIT - PostgreSQL 튜닝 실천 기법한 것은 다음의 매개 변수1. postgresql.conf · shared_buffers (공유 버퍼) · sort_mem (정렬 메모리) · wal_ buffers (트랜잭션 로그 버퍼) · checkpoint_segments (체크 포인트 세그먼트) · max_fsm_pages (FSM [Free Space Map))2. shmmax (커널의 공유 메모리) / proc / sys / kernel / shmmax /etc/sysctl.conf 이번에는 캐시 기능을 활용하여 캐시 적중률을 높이는 것이 큰 목적 이었기 때..