私は分散Postgresデータベースシステムをセットアップし、hot_standby wal_levelを使って複製を設定しました。distributed postgres depolyment of sync
読み取り専用インスタンスとして使用される複数のレプリカ(現在は世界中で15個)の中央マスタデータベースが1つあります。フェールオーバーは必要ありません。データをリモートの場所に同期させたいだけです。それらを読みます。
マスター:
wal_level = hot_standby
max_wal_senders = 20
checkpoint_segments = 8
wal_keep_segments = 8
クライアント:クライアント側の
wal_level = hot_standby
max_wal_senders = 3
checkpoint_segments = 8
wal_keep_segments = 8
hot_standby = on
が/var/lib/postgresql/9.4/recovery.conf:
standby_mode = 'on'
primary_conninfo = 'host=<IP of master> port=5432 user=replicator password=xxxx sslmode=require'
trigger_file = '/tmp/postgresql.trigger'
レプリケーションが開始 - すべていくつかの日のためにうまくいくようです。複製のためのマスターで受け入れられていない多くの接続があると思われるいくつかの日後の ...
クライアント:
2017-05-04 01:16:51 UTC [9608-1] FATAL: could not connect to the primary server: FATAL: sorry, too many clients already
2017-05-04 01:16:57 UTC [10807-1] FATAL: could not connect to the primary server: FATAL: sorry, too many clients already
2017-05-04 01:17:02 UTC [12022-1] FATAL: could not connect to the primary server: FATAL: sorry, too many clients already
2017-05-04 01:17:06 UTC [13217-1] FATAL: could not connect to the primary server: FATAL: remaining connection slots are reserved for non-replication superuser connections
...
マスター:
、その後loagは、以下のようなメッセージでいっぱいになります - それが回復したことがない...
2017-05-04 08:44:14 UTC [24850-1] [email protected][unknown] ERROR: requested WAL segment 000000010000003500000014 has already been removed
2017-05-04 08:44:19 UTC [25958-1] [email protected][unknown] ERROR: requested WAL segment 000000010000003500000014 has already been removed
2017-05-04 08:44:24 UTC [27063-1] [email protected][unknown] ERROR: requested WAL segment 000000010000003500000014 has already been removed
2017-05-04 08:44:29 UTC [28144-1] [email protected][unknown] ERROR: requested WAL segment 000000010000003500000014 has already been removed
2017-05-04 08:44:34 UTC [29227-1] [email protected][unknown] ERROR: requested WAL segment 000000010000003500000014 has already been removed
2017-05-04 08:44:39 UTC [30316-1] [email protected][unknown] ERROR: requested WAL segment 000000010000003500000014 has already been removed
...
はクライアント:
2017-04-30 11:26:22 UTC [28474-1] LOG: started streaming WAL from primary at 35/14000000 on timeline 1
2017-04-30 11:26:22 UTC [28474-2] FATAL: could not receive data from WAL stream: ERROR: requested WAL segment 000000010000003500000014 has already been removed
2017-04-30 11:26:26 UTC [29328-1] LOG: started streaming WAL from primary at 35/14000000 on timeline 1
2017-04-30 11:26:26 UTC [29328-2] FATAL: could not receive data from WAL stream: ERROR: requested WAL segment 000000010000003500000014 has already been removed
2017-04-30 11:26:31 UTC [30394-1] LOG: started streaming WAL from primary at 35/14000000 on timeline 1
2017-04-30 11:26:31 UTC [30394-2] FATAL: could not receive data from WAL stream: ERROR: requested WAL segment 000000010000003500000014 has already been removed
...
ので、私の質問:
- だけで、リモートの読み取り専用インスタンスへの変更を同期するか、私はいくつかの時間後に私のレプリケーションの休憩を作るのconfigsのエラーを持っているか良い方法はありますか?
あなたの助けをたくさん!
archive_command(recovery.confから)を使用してWALを保存していない場合は、実際には '000000010000003500000014'はありません。複製を再構築する必要があります。 –
質問の数を減らしてください。 config ... –
以下ではどういう意味ですか? WALを保存するためにarchive_command(あなたのrecovery.confから)を使用せず、000000010000003500000014を持っていない場合 – roegi