2016-08-08 75 views
0

Ich versuche, eine postgres Replikationskonfiguration mit zwei Servern zu erstellen. Die Schritte sind ähnlich wie PostgreSQL 9.4 Replication with RepMgr and PgBouncer on Ubuntu 14.04 . Ich verwende repmgr + pgbouncer als meine Replikationskonfiguration. Angenommen, ich habe zwei Hosts, dhost1 und dhost2. Repmgr Metadaten db ist repmgrdb und Benutzer ist repmgr_user.
Dhost1 hat Pgbouncer und Repmgr-Konfiguration und es ist der Master. Die Konfiguration des Repmgr in dbhost1 ist nachfolgend aufgeführt:[Postgres Replication] Remote-Host ist nicht erreichbar Repmgr Salve

cluster = test 

node = 1 
node_name = dhost1 
use_replication_slots = 1 
conninfo='host=dhost1 user=repmgr_user dbname=repmgrdb' 
pg_bindir=/usr/lib/postgresql/9.5/bin 
## repmgr.conf at master ## 

dhost2 hat auch Repmgr config und es ist im Slave-Modus. Es ist config ist unten erwähnt

Ich bin in der Lage, um den Master erfolgreich registrieren und kann Master im Cluster Show-Befehl gesehen werden.

auf Slave-Seite mit I pg_basebackup Methode mit dem Befehl

repmgr -f /etc/repmgr/repmgr.conf --force -h dhost1_ip_address_goes_here> -U repmgr_user -d repmgrdb -v standby clone 

Master klonen ich die folgenden Fehler Für den obigen Befehl erhalten:

[2016-08-08 10:05:26] [NOTICE] using configuration file "/etc/repmgr/repmgr.conf" 
[2016-08-08 10:05:26] [NOTICE] setting data directory to: /var/lib/postgresql/9.5/main 
[2016-08-08 10:05:26] [HINT] use -D/--data-dir to explicitly specify a data directory 
[2016-08-08 10:05:26] [NOTICE] starting backup (using pg_basebackup)... 
[2016-08-08 10:05:26] [HINT] this may take some time; consider using the -c/--fast-checkpoint option 
[2016-08-08 10:05:31] [NOTICE] copying configuration files from master 
[2016-08-08 10:05:31] [ERROR] aborting, remote host <dhost1_ip_address_goes_here> is not reachable. 
[2016-08-08 10:05:31] [ERROR] unable to take a base backup of the master server> 
[2016-08-08 10:05:31] [WARNING] destination directory (/var/lib/postgresql/9.5/main) may need to be cleaned up manually 

Ich habe auch festgelegt kennwort weniger ssh für postgres Benutzer zwischen dhost1 und dhost2.

Auch konnte ich pg_basebackup von Kommando zu übernehmen

pg_basebackup -h <dhost1_ip_address_goes_here> -P -v -U repmgr_user -X stream -D 9.5/main -R 

ich sehr Anfänger für postgresql Replikation bin mir bitte Antworten vorschlagen.

Antwort

0

Ich untersuche das gerade jetzt. Sie könnten den Befehl erneut mit
--log-Ebene wollen laufen DEBUG --verbose, dass einige weitere Informationen über dort auf, was geben sollte geht ...

-1

1-st

rm -rf/var/lib/postgresql/9,5/main/*

2-nd

repmgr -h masterhostname -p 5433 -U repmgr -d repmgr -D Haupt -f /etc/repmgr.conf --copy- external-config-files = pgdata --verbose Bereitschaftsklon

3-rd

pg_ctl -D /var/lib/postgresql/9.5/main --log =/var/log/postgresql/postgres_screen.log 4-ten

repmgr -f/etc Start/repmgr/repmgr.conf Bereitschaftsregister;

repmgr -f /etc/repmgr/repmgr.conf Cluster zeigen

+2

Bitte um eine Erklärung hinzuzufügen. – jmattheis