Bom dia pessoal.

Tenho o seguinte cenário para replicação nativa master/slave com postgres
9.0.
Instalei o rsync, criei as chaves publicas com ssh-keygen e dei um ssh-copy
para os servidores master/slave, ate ai tudo tranquilo;

Servidor Master
SO : Debian 6
BD : Postgres 9.0.4
ip:10.1.3.118

Servidor Slave
SO : Debian 6
BD : Postgres 9.0.4
ip: 10.1.3.119

1 configurações no master no postgresql.conf

listen_addresses = '*'

port = 5432
wal_level = hot_standby
archive_mode = on
archive_command ='rsync -a %p 10.1.3.119:/home/postgres/replication/%f'
max_wal_senders = 2
#wal_sender_delay = 200ms
wal_keep_segments = 20

1.1 configurações no master no pg_hba.conf

host replication         all     0.0.0.0/0
trust

1.2 confirmei se os archives foram gerados na pasta
/home/postgres/replication do servidor master e foi gerados:

 /usr/local/pgsql/bin$ ./psql -d postgres -c "SELECT pg_start_backup('OK');"

 pg_start_backup

-----------------

 0/5000020

(1 row)

/usr/local/pgsql/data$ ls -la /home/postgres/replication/

total 65628

drwxr-xr-x 2 postgres postgres     4096 Jul  7 14:07 .

drwxr-xr-x 4 postgres postgres     4096 Jul  7 14:01 ..

-rw------- 1 postgres postgres 16777216 Jul  7 09:29
000000010000000000000001

-rw------- 1 postgres postgres 16777216 Jul  7 09:30
000000010000000000000002

-rw------- 1 postgres postgres      235 Jul  7 09:30
000000010000000000000002.00000020.backup

-rw------- 1 postgres postgres 16777216 Jul  7 11:54
000000010000000000000003

-rw------- 1 postgres postgres 16777216 Jul  7 14:07
000000010000000000000004


2 - configurações no slave no postgresql.conf

2.1 backup da pasta data do master e extrai no diretorio data do slave;

2.2 rm -rf /pg_xlog/*

2.3 rm -rf postmaster.pid

2.4 alterei o postgresql.conf do slave

listen_addresses = '*'

wal_level = minimal

port = 5434
archive_mode = off
hot_standby = on


2.5 crei um arquivo recovery.conf no slave

standby_mode = 'on'
primary_conninfo = 'host=10.1.3.118 port=5432 user=postgres
password='q1w2e3r4'
restore_command = 'cp /home/postgres/replication%f %p'
trigger_file = '/tmp/trigger.pgsql.5432'

2.6 O problema quando tento subir o servidor
root@pgsql2:~# /etc/init.d/rc.postgresql start
Starting PostgreSQL: ok

Porém quando dou um grep nos processos não estar no ar o servidor.

Alguém pode me ajudar ai..






Emerson Martins
DBA Junior
82 9123-5504
82 9668-1283
_______________________________________________
pgbr-geral mailing list
[email protected]
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral

Responder a