*Configurações de hardware das máquinas:*
*MASTER*
*Operating system Ubuntu Linux 14.04.3Processor information Intel(R)
Xeon(R) CPU E5-2620 v3 @ 2.40GHz, 24 coresReal memory 7.77 GB used,
47.05 GB totalPostgres 9.3.10*
*SLAVE*
*Operating system Ubuntu Linux 14.04.4Processor information Intel(R)
Xeon(R) CPU E5530 @ 2.40GHz, 16 coresReal memory 1.03 GB used, 23.53 GB
totalPostgres 9.3.12*
*Segue arquivo de configuração do master:*
*data_directory = '/base/pgdata' # use data in another
directoryhba_file = '/etc/postgresql/9.3/main/pg_hba.conf' # host-based
authentication fileident_file = '/etc/postgresql/9.3/main/pg_ident.conf'
# ident configuration fileexternal_pid_file =
'/var/run/postgresql/9.3-main.pid' # write an extra PID
filelisten_addresses = '*' # what IP address(es) to listen on;port =
5432 # (change requires restart)max_connections = 400
# (change requires restart)unix_socket_directories =
'/var/run/postgresql' # comma-separated list of directoriesssl = true
# (change requires restart)ssl_cert_file =
'/etc/ssl/certs/ssl-cert-snakeoil.pem' # (change requires
restart)ssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key' #
(change requires restart)shared_buffers = 12GB #8GB # min
128kBwork_mem = 15728kB #328MB # min 64kBmaintenance_work_mem =
2GB # min 1MBwal_level = hot_standby # minimal, archive,
or hot_standbywal_buffers = 16MB # min 32kB, -1 sets based on
shared_bufferscheckpoint_segments = 16 #64 # in logfile segments,
min 1, 16MB eachcheckpoint_completion_target = 0.9 # checkpoint target
duration, 0.0 - 1.0max_wal_senders = 1 # max number of walsender
processeswal_keep_segments = 20 # in logfile segments, 16MB each; 0
disableseffective_cache_size = 36GBlog_destination = 'stderr' #
Valid values are combinations oflogging_collector = on # Enable
capturing of stderr and csvloglog_directory = 'pg_log' # directory
where log files are written,log_filename = 'postgresql-%d-%m-%Y.log' #
log file name pattern,log_truncate_on_rotation = on # If on, an
existing log file with thelog_rotation_age = 1d # Automatic
rotation of logfiles willlog_rotation_size = 10MB # Automatic
rotation of logfiles willclient_min_messages = notice # values in
order of decreasing detail:log_min_messages = warning # values in
order of decreasing detail:log_min_error_statement = error # values
in order of decreasing detail:log_min_duration_statement = 3000 # -1 is
disabled, 0 logs all statementslog_checkpoints = onlog_connections =
onlog_disconnections = onlog_duration = offlog_error_verbosity = verbose
# terse, default, or verbose messageslog_hostname = onlog_line_prefix =
'%t [%p]: [%l-1] user=%u,db=%d ' # special values:log_lock_waits
= on # log lock waits >= deadlock_timeoutlog_statement =
'none' # none, ddl, mod, alllog_temp_files = 0 # log
temporary files equal or largerlog_timezone = 'localtime'autovacuum =
off # Enable autovacuum subprocess? 'on'datestyle = 'iso,
dmy'timezone = 'localtime'client_encoding = LATIN1 # actually,
defaults to databaselc_messages = 'pt_BR.UTF-8' # locale for
system error messagelc_monetary = 'pt_BR.UTF-8' # locale for
monetary formattinglc_numeric = 'pt_BR.UTF-8' # locale for
number formattinglc_time = 'pt_BR.UTF-8' # locale for time
formattingdefault_text_search_config =
'pg_catalog.portuguese'escape_string_warning =
offstandard_conforming_strings = off*
*Arquivo de configuração do slave:*
*data_directory = '/base/pgdata' # use data in another
directoryhba_file = '/etc/postgresql/9.3/main/pg_hba.conf' # host-based
authentication fileident_file = '/etc/postgresql/9.3/main/pg_ident.conf'
# ident configuration fileexternal_pid_file =
'/var/run/postgresql/9.3-main.pid' # write an extra PID
filelisten_addresses = '*' # what IP address(es) to listen on;port =
5432 # (change requires restart)max_connections = 400
# (change requires restart)unix_socket_directories =
'/var/run/postgresql' # comma-separated list of directoriesssl = true
# (change requires restart)ssl_cert_file =
'/etc/ssl/certs/ssl-cert-snakeoil.pem' # (change requires
restart)ssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key' #
(change requires restart)shared_buffers = 12GB # min
128kBwork_mem = 15728kB # min 64kBwal_level = hot_standby
# minimal, archive, or hot_standbywal_buffers = 16MB #
min 32kB, -1 sets based on shared_bufferscheckpoint_segments = 16 #
in logfile segments, min 1, 16MB eachcheckpoint_completion_target = 0.9
# checkpoint target duration, 0.0 - 1.0archive_mode = off # allows
archiving to be donemax_wal_senders = 3 # max number of walsender
processeshot_standby = on # "on" allows queries during
recoverylog_line_prefix = '%t ' # special values:log_timezone =
'localtime'datestyle = 'iso, dmy'timezone = 'localtime'lc_messages =
'pt_BR.UTF-8' # locale for system error messagelc_monetary =
'pt_BR.UTF-8' # locale for monetary formattinglc_numeric =
'pt_BR.UTF-8' # locale for number formattinglc_time =
'pt_BR.UTF-8' # locale for time
formattingdefault_text_search_config = 'pg_catalog.portuguese'*
*Arquivo recovery.conf salvo na pasta pgdata no slave*
*standby_mode = 'on'primary_conninfo = 'host=10.1.2.12 port=5432
user=replicador'trigger_file = '/base/pgdata/failover.trg'*
Desde já obrigado pela ajuda.
Att,
Diógenes V. Bittencourt
Em 10 de maio de 2016 13:31, Euler Taveira <[email protected]> escreveu:
> On 10-05-2016 11:00, Diógenes Vargas de Bittencourt wrote:
> > Bom dia pessoal, sou novo nesta lista, e gostaria de tirar uma dúvida
> > que está me deixando careca, literalmente, hehe.
> > Tenho postgres 9.3 instalado em um ubuntu 12.04 em produção. Fiz as
> > configurações para replicação em outra máquina com o mesmo S.O. mesma
> > versão do banco também.
> >
> 9.3.oque? Cadê as configurações da produção [1]? E o arquivo recovery.conf?
>
> > *Após esse erro ví em vários foruns que rodando o comando resetxlog
> > poderia resolver, pois bem, fiz isso e segue abaixo o que ocorreu
> depois:*
> > /postgres@server2:/base$ /usr/lib/postgresql/9.3/bin/pg_resetxlog -f
> > /base/pgdata/
> > Transaction log reset/
> >
> Não, pg_resetxlog não vai resolver seu problema. 99% das pessoas que
> usam o pg_resetxlog *não* sabem o que estão fazendo. Jamais use ele numa
> base em produção e sem problemas; ele geralmente leva a perda de
> transações.
>
>
> [1] https://gist.github.com/eulerto/450501d8ef00404e665b46a2f2a6e8e2
>
>
> --
> Euler Taveira Timbira - http://www.timbira.com.br/
> PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento
> _______________________________________________
> pgbr-geral mailing list
> [email protected]
> https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral
_______________________________________________
pgbr-geral mailing list
[email protected]
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral