[ The imperialist Japanese military must officially acknowledge and apologize for the coercion of young women into sexual slaves. / 幼い女性を性の奴隷にした帝國主義日本軍の?制性を公式に認め、謝罪しなければならない. ]

사용자

ID:
PW:

INDEX
01.게시판
게시판 [71]
02.File Book
File 자료실 [96]
Site Link [14]
개인폴더 [201]
03.Field Book
Altibase [19]
Tibero [30]
MS-SQL [25]
MySQL [43]
DB2 [79]
ORACLE [3054]
PSQL [135]
CUBRID [5]
기타정보 [158]
운영체제 [607]
04.Q/A Book
Q/A [53]
05.방명록
방명록 [54]
레벨업 [37]
구인/구직 [2]

기념일
Search
LINK
+ 가족 Hompy
+ DNSEver
IOTN :: Field Book :: PostgreSQL

 회원가입

psql HA
최길호 [LIST]   2023-02-05 08:24:22, 조회 : 62

psql HA 구축

##  master
------------------------------------------------
vi $PGDATA/postgresql.conf
listen_addresses =  '*'

vi $PGDATA/postgresql.auto.conf
wal_level = hot_standby
max_wal_senders = 2 # +1

grep 127 $PGDATA/pg_hba.conf
host    replication     all             127.0.0.1/32            trust

CREATE ROLE replication WITH REPLICATION PASSWORD 'postgrespwd' LOGIN;
alter user postgres password 'postgrespwd';


##  slave
------------------------------------------------
export PGDATA=/home/postgres/ha
rm -rf /home/postgres/ha/*
pg_basebackup -h localhost -D /home/postgres/ha -U replication -v -P -X stream
chmod 750 $PGDATA

## standby_mode 변경 to $PGDATA/standby.signal
touch $PGDATA/standby.signal
touch $PGDATA/recovery.signal

## $PGDATA/recovery.conf
## recovery.conf 제거 to recovery.signal , standby.signal
## FATAL:  using recovery command file "recovery.conf" is not supported

vi $PGDATA/postgresql.auto.conf
hot_standby = 'on'
hot_standby_feedback = 'on'
port = 5433
## standby_mode = 'on' ## LOG:  unrecognized configuration parameter "standby_mode"
primary_conninfo='host=localhost port=5432 user=replication password=postgrespwd'
#promotion_trigger_file=

tail -f $PGDATA/log/postgresql-Sun.log
export PGDATA=/home/postgres/ha
pg_ctl start
psql -p 5433

## pg_controldata
master
pg_controldata -D $PGDATA | grep clu
Database cluster state:               in production
slave
pg_controldata -D /home/postgres/ha | grep clu
Database cluster state:               in archive recovery

## master
postgres=# select usename,client_addr,state,sync_state,reply_time from pg_stat_replication;
   usename   | client_addr |   state   | sync_state |          reply_time          
-------------+-------------+-----------+------------+-------------------------------
replication | 127.0.0.1   | streaming | async      | 2023-02-06 09:59:00.812877+09
(1 row)
## slave
postgres=# select sender_host,status,latest_end_time from pg_stat_wal_receiver;
sender_host |  status   |        latest_end_time        
-------------+-----------+-------------------------------
localhost   | streaming | 2023-02-06 09:52:07.390205+09


3.239.9.151


  LIST

제목 작성자 작성일 조회
Admin  pg_backup_start / pg_backup_stop / psql 세션 유지 / WARNING: aborting backup due to backend exiting before pg_backup_stop was called    최길호 2023/12/21 25
Admin  psql 10.7 oracle dblink [ oracle_fdw db link ]    최길호 2023/07/25 29
Admin  HA 복구 test    최길호 2023/03/03 45
Admin  log: COPY public.xxxx (xxx, xxx, xxx) TO stdout; / pg_dump 백업시 발생    최길호 2023/03/03 23
Admin  requested timeline x is not a child of this server's history    최길호 2023/03/02 22
Admin  recovery_target_action / archive log 받아서 계속 복구    최길호 2023/02/28 34
Admin  recovery_target_action = 'pause' / select pg_wal_replay_pause(); / select pg_get_wal_replay_pause_state();    최길호 2023/02/27 14
Admin  memory buffer cache    최길호 2023/02/06 19
Admin  active session, pid, lock sql , kill pid / pg_terminate_backend    최길호 2023/02/06 77
Admin  psql HA    최길호 2023/02/05 62
Admin  pg_ctl start -D . | postmaster.pid | /tmp/.s.PGSQL.5432 |    최길호 2023/02/03 39
Admin  pg_waldump    최길호 2023/02/03 18
Troubleshoot  $PGDATA/pg_wal/00000002.history 없는경우 [ ERROR: could not open file "pg_wal/00000002.history": ENOENT ]    최길호 2023/02/02 33
Admin  shmem_exit(0): 0 before_shmem_exit callbacks to make [ 로그 기록용 ]    최길호 2023/02/01 58
Troubleshoot  LOG: invalid resource manager ID in primary checkpoint record    최길호 2023/02/01 33
Admin  pg_restore [ 다른 계정, 다른 DB, sql 파일로 저장 ]    최길호 2023/01/30 26
Admin  pg_basebackup pg_dump pg_dumpall backup script    최길호 2023/01/30 122
Admin  session 정보    최길호 2023/01/27 30

    목록보기   다음페이지 1 [2][3][4][5][6][7]
       

Copyright 1999-2024 Zeroboard / skin by 최길호(gilho.kr@gmail.com)
최근 댓글
최근 게시물
03/04
[기타정보]
아두이노 wifi web test.
by 최길호
03/01
[기타정보]
아두이노 스마트하우스 V2.
by 최길호
02/28
[ORACLE]
plsql run sql from column / 테....
by 최길호