...
Regards,
Marco
--
Marco Nenciarini - 2ndQuadrant Italy
PostgreSQL Training, Services and Support
marco.nenciarini@2ndQuadrant.it | www.2ndQuadrant.it
[customer]description = "Customer Database"ssh_command = ssh post...@10.20.30.10conninfo = host=10.20.30.10 sslmode=require port=19999 user=postgres password=XXXXXXXXXXXXXXXXXXXX application_name=barman[barman]barman_user = barmanconfiguration_files_directory = /etc/barman.dbarman_home = /dados/barmanlog_file = /var/log/barman/barman.loglog_level = INFOcompression = gzipreuse_backup = linkretention_policy = REDUNDANCY 6bandwidth_limit = 0parallel_jobs = 2network_compression = falsebasebackup_retry_times = 2basebackup_retry_sleep = 30check_timeout = 120archiver = onbackup_options = concurrent_backup#!/bin/bash
systemctl stop pgCustomer-96.servicerm -rf /dados/restore/9.6/pgCustomermkdir /dados/restore/9.6/pgCustomerchown -R barman: /dados/restore/9.6/pgCustomerchmod ug=rwx /dados/restore/9.6/pgCustomerbarman receive-wal customer
if [ -z "$2" ]; then echo "Restaurando com parâmetro LAST" barman recover customer last /dados/restore/9.6/pgCustomerelse echo "Restaurando para PIT $2" barman recover customer last --target-time "$2" /dados/restore/9.6/pgCustomerfi
chown -R postgres: /dados/restore/9.6/pgCustomercp /usr/lib/systemd/system/postgresql-9.6.service /etc/systemd/system/pgCustomer-96.servicesed -i "s/PGDATA=\\/var\\/lib\\/pgsql\\/9.6\\/data\\//PGDATA=\\/dados\\/restore\\/9.6\\/pgCustomer\\//g" /etc/systemd/system/pgCustomer-96.servicesystemctl daemon-reloadsystemctl enable pgCustomer-96.servicesystemctl start pgCustomer-96.servicerestore_command = 'cp barman_xlog/%f %p'
recovery_end_command = 'rm -fr barman_xlog'recovery_target_time = '2017-12-19 10:00:00'backup_label='START WAL LOCATION: B2/32FF2220 (file 00000001000000B200000032)\nCHECKPOINT LOCATION: B2/33073650\nBACKUP METHOD: streamed\nBACKUP FROM: standby\nSTART TIME: 2017-12-19 02:41:05 -02\nLABEL: Barman backup customer 20171219T023618\n'begin_offset=16720416begin_time=2017-12-19 02:36:18.126166-02:00begin_wal=00000001000000B200000032begin_xlog=B2/32FF2220config_file=/dados/pgsql/9.6/pgCustomer/postgresql.confcopy_stats={'total_time': 2440.284258, 'number_of_workers': 2, 'serialized_copy_time': 4644.852814, 'serialized_copy_time_per_item': {'hba_file': 1.935564, 'pgdata': 4642.584175, 'pg_control': 0.333075}, 'analysis_time': 108.967868, 'copy_time': 2331.181703, 'analysis_time_per_item': {'pgdata': 108.967868}, 'copy_time_per_item': {'hba_file': 1.935564, 'pgdata': 2330.847051, 'pg_control': 0.333075}}deduplicated_size=54562879023end_offset=2049192end_time=2017-12-19 03:21:45.498115-02:00end_wal=00000001000000B200000035end_xlog=B2/351F44A8error=Nonehba_file=/dados/pgsql/9.6/pg_hba.confident_file=/dados/pgsql/9.6/pgCustomer/pg_ident.confincluded_files=Nonemode=rsync-concurrentpgdata=/dados/pgsql/9.6/pgCustomerserver_name=customersize=98675296925status=DONEtablespaces=Nonetimeline=1version=90604xlog_segment_size=16777216
[root@server2 1106839]# find 6302536 -exec stat \{\} \; File: “6302536” Size: 16793600 Blocks: 32800 IO Block: 4096 arquivo comumDevice: f902h/63746d Inode: 10618465 Links: 1Access: (0600/-rw-------) Uid: ( 26/postgres) Gid: ( 26/postgres)Access: 2017-12-08 21:35:38.670841051 -0200Modify: 2017-12-21 22:51:40.706074439 -0200Change: 2017-12-21 22:51:40.706074439 -0200 Birth: -[root@server3 1106839]# find 6302536 -exec stat \{\} \; File: “6302536” Size: 0 Blocks: 0 IO Block: 4096 arquivo comum vazioDevice: f901h/63745d Inode: 391519656 Links: 1Access: (0600/-rw-------) Uid: ( 26/postgres) Gid: ( 26/postgres)Access: 2017-12-09 15:50:47.469135640 -0200Modify: 2017-12-09 15:50:47.469135640 -0200Change: 2017-12-09 15:50:47.469135640 -0200 Birth: -[root@server4 base]# find -name 6302536 -exec stat \{\} \; File: “./20171211T022831/data/base/1106839/6302536” Size: 0 Blocks: 0 IO Block: 4096 arquivo comum vazioDevice: f906h/63750d Inode: 12885234877 Links: 6Access: (0600/-rw-------) Uid: ( 996/ barman) Gid: ( 992/ barman)Access: 2017-12-11 02:33:04.565445268 -0200Modify: 2017-12-09 15:50:47.000000000 -0200Change: 2017-12-21 02:43:48.254961471 -0200 Birth: - File: “./20171213T023610/data/base/1106839/6302536” Size: 0 Blocks: 0 IO Block: 4096 arquivo comum vazioDevice: f906h/63750d Inode: 12885234877 Links: 6Access: (0600/-rw-------) Uid: ( 996/ barman) Gid: ( 992/ barman)Access: 2017-12-11 02:33:04.565445268 -0200Modify: 2017-12-09 15:50:47.000000000 -0200Change: 2017-12-21 02:43:48.254961471 -0200 Birth: - File: “./20171215T023827/data/base/1106839/6302536” Size: 0 Blocks: 0 IO Block: 4096 arquivo comum vazioDevice: f906h/63750d Inode: 12885234877 Links: 6Access: (0600/-rw-------) Uid: ( 996/ barman) Gid: ( 992/ barman)Access: 2017-12-11 02:33:04.565445268 -0200Modify: 2017-12-09 15:50:47.000000000 -0200Change: 2017-12-21 02:43:48.254961471 -0200 Birth: - File: “./20171217T023855/data/base/1106839/6302536” Size: 0 Blocks: 0 IO Block: 4096 arquivo comum vazioDevice: f906h/63750d Inode: 12885234877 Links: 6Access: (0600/-rw-------) Uid: ( 996/ barman) Gid: ( 992/ barman)Access: 2017-12-11 02:33:04.565445268 -0200Modify: 2017-12-09 15:50:47.000000000 -0200Change: 2017-12-21 02:43:48.254961471 -0200 Birth: - File: “./20171219T023618/data/base/1106839/6302536” Size: 0 Blocks: 0 IO Block: 4096 arquivo comum vazioDevice: f906h/63750d Inode: 12885234877 Links: 6Access: (0600/-rw-------) Uid: ( 996/ barman) Gid: ( 992/ barman)Access: 2017-12-11 02:33:04.565445268 -0200Modify: 2017-12-09 15:50:47.000000000 -0200Change: 2017-12-21 02:43:48.254961471 -0200 Birth: - File: “./20171221T024146/data/base/1106839/6302536” Size: 0 Blocks: 0 IO Block: 4096 arquivo comum vazioDevice: f906h/63750d Inode: 12885234877 Links: 6Access: (0600/-rw-------) Uid: ( 996/ barman) Gid: ( 992/ barman)Access: 2017-12-11 02:33:04.565445268 -0200Modify: 2017-12-09 15:50:47.000000000 -0200Change: 2017-12-21 02:43:48.254961471 -0200 Birth: -marco.nenciarini@2ndQuadrant.it | www.2ndQuadrant.it
marco.nenciarini@2ndQuadrant.it | www.2ndQuadrant.it
Hi Edson,
Il 22/12/17 14:13, Edson Richter ha scritto:
> I keep only a week of logs (I'll change that).
> The error has been detected only when I've restored the database.
> Replication is running without errors for long time. I've created a tool
> that alerts me if the standby falls behind the master:
>
> <https://lh3.googleusercontent.com/-BRgvpr_Ws7Y/Wj0Eay7lMLI/AAAAAAAABMg/cInGQTAfww4yLS98M-1Duj6PBx1GvmwJQCLcBGAs/s1600/2017-12-22%2B11_04_08-Monitor%2Bde%2Breplica%25C3%25A7%25C3%25A3o%2BPostgreSQL.png>
>
>
> So, there is not error in the replication it self - it is active and
> working. But there is a hole in standby, and I can't explain why.
> I'll try to make further investigation. But right now, I need to rebuild
> the standby, and it will take dozen hours because of data size.
>
I have another question: Is is by any chance an unlogged table?
No, it is a normal table.