首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么Barman不压缩WAL文件

为什么Barman不压缩WAL文件
EN

Stack Overflow用户
提问于 2022-10-13 23:26:57
回答 1查看 73关注 0票数 0

我们的Barman安装似乎没有压缩WAL文件。wal文件大小与Postgresql服务器上的文件大小相同。我们打开了streaming_archiver,在barman show-server中,压缩设置为pigz,但wal_compression显示为off。酒保的版本是2.12。

提前谢谢。

barman show-server v2db

代码语言:javascript
复制
Server v2db:
        active: True
        archive_timeout: 0
        archiver: False
        archiver_batch_size: 0
        backup_directory: /var/lib/barman/v2db
        backup_method: rsync
        backup_options: BackupOptions({'concurrent_backup'})
        bandwidth_limit: None
        barman_home: /var/lib/barman
        barman_lock_directory: /var/lib/barman
        basebackup_retry_sleep: 30
        basebackup_retry_times: 3
        basebackups_directory: /var/lib/barman/v2db/base
        check_timeout: 30
        checkpoint_timeout: 300
        compression: pigz
        config_file: /etc/postgresql/12/main/postgresql.conf
        connection_error: None
        conninfo: host=**********
        create_slot: manual
        current_lsn: 50/35C7FF00
        current_size: 49459828350
        current_xlog: 000000010000005000000035
        custom_compression_filter: None
        custom_decompression_filter: None
        data_checksums: off
        data_directory: /var/lib/postgresql/12/main
        description: Backups from DB
        disabled: False
        errors_directory: /var/lib/barman/v2db/errors
        has_backup_privileges: True
        hba_file: /etc/postgresql/12/main/pg_hba.conf
        hot_standby: on
        ident_file: /etc/postgresql/12/main/pg_ident.conf
        immediate_checkpoint: False
        included_files: ['/etc/postgresql/12/main/conf.d/9999-override.conf']
        incoming_wals_directory: /var/lib/barman/v2db/incoming
        is_in_recovery: False
        is_superuser: True
        last_backup_maximum_age: 7 days (latest backup: 2 hours, 52 minutes, 55 seconds )
        max_incoming_wals_queue: None
        max_replication_slots: 10
        max_wal_senders: 10
        minimum_redundancy: 3
        msg_list: []
        name: v2db
        network_compression: False
        parallel_jobs: 1
        passive_node: False
        path_prefix: /usr/lib/postgresql/12/bin
        pg_receivexlog_compatible: True
        pg_receivexlog_installed: True
        pg_receivexlog_path: /usr/lib/postgresql/12/bin/pg_receivewal
        pg_receivexlog_supports_slots: True
        pg_receivexlog_synchronous: False
        pg_receivexlog_version: 12.6
        pgespresso_installed: False
        post_archive_retry_script: None
        post_archive_script: None
        post_backup_retry_script: None
        post_backup_script: None
        post_delete_retry_script: None
        post_delete_script: None
        post_recovery_retry_script: None
        post_recovery_script: None
        post_wal_delete_retry_script: None
        post_wal_delete_script: None
        postgres_systemid: 6902948791374441963
        pre_archive_retry_script: None
        pre_archive_script: None
        pre_backup_retry_script: None
        pre_backup_script: None
        pre_delete_retry_script: None
        pre_delete_script: None
        pre_recovery_retry_script: None
        pre_recovery_script: None
        pre_wal_delete_retry_script: None
        pre_wal_delete_script: None
        primary_ssh_command: None
        recovery_options: RecoveryOptions({'get-wal'})
        replication_slot: Record(slot_name='backup_pgsql_masterbarman', active=True, restart_lsn='50/35000000')
        replication_slot_support: True
        retention_policy: RECOVERY WINDOW OF 4 WEEKS
        retention_policy_mode: auto
        reuse_backup: link
        server_txt_version: 12.12
        slot_name: backup_pgsql_masterbarman
        ssh_command: ssh -q postgres@******
        streaming: True
        streaming_archiver: True
        streaming_archiver_batch_size: 0
        streaming_archiver_name: barman_receive_wal
        streaming_backup_name: barman_streaming_backup
        streaming_conninfo: host=********
        streaming_supported: True
        streaming_systemid: 6902948791374441963
        streaming_wals_directory: /var/lib/barman/v2db/streaming
        synchronous_standby_names: ['']
        tablespace_bandwidth_limit: None
        timeline: 1
        wal_compression: off
        wal_keep_segments: 0
        wal_level: replica
        wal_retention_policy: MAIN
        wals_directory: /var/lib/barman/v2db/wals
        xlog_segment_size: 16777216
        xlogpos: 50/35C7FF00

barman.conf:

代码语言:javascript
复制
[barman]
barman_home = /var/lib/barman
barman_user = barman

log_file = /var/log/barman/barman.log

; rsync or postgres
backup_method = rsync
parallel_jobs = 1

; Incremental backup support: possible values are off (default), link or copy
reuse_backup = link

; Identify the standard behavior for backup operations: possible values are
; exclusive_backup (default), concurrent_backup
backup_options = concurrent_backup

; Immediate checkpoint for backup command - default false
immediate_checkpoint = False

; Global bandwidth limit in KBPS - default 0 (meaning no limit)
;bandwidth_limit = 4000

; Default compression level: possible values are None (default), bzip2, gzip, pigz, pygzip or pybzip2
compression = pigz

; Enable network compression for data transfers - default false
network_compression = False

; Number of retries of data copy during base backup after an error - default 0
basebackup_retry_times = 3

; Number of seconds of wait after a failed copy, before retrying - default 30
basebackup_retry_sleep = 30

; Minimum number of required backups (redundancy) - default 0
minimum_redundancy = 3

; Global retention policy (REDUNDANCY or RECOVERY WINDOW) - default empty
retention_policy = RECOVERY WINDOW OF 4 WEEKS

; Recovery options (influences recovery.conf written by barman recover)
recovery_options = 'get-wal'

; Time frame that must contain the latest backup date.
; If the latest backup is older than the time frame, barman check
; command will report an error to the user.
; If empty, the latest backup is always considered valid.
; Syntax for this option is: "i (DAYS | WEEKS | MONTHS)" where i is an
; integer > 0 which identifies the number of days | weeks | months of
; validity of the latest backup for this check. Also known as 'smelly backup'.
last_backup_maximum_age = 1 WEEK

configuration_files_directory = /etc/barman.d

path_prefix = /usr/lib/postgresql/12/bin

server.conf:

代码语言:javascript
复制
[v2db]
description = "Backups from DB"

ssh_command = "ssh -q postgres@******"
conninfo = "********** "
streaming_conninfo = "************** "
streaming_archiver = on
slot_name = "backup_pgsql_masterbarman"

active = true
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-10-14 12:23:53

参数wal_compression是从PostgreSQL服务器配置中获取的。这意味着您已经在数据库服务器上配置了wal_compression = off。登录psql并:

代码语言:javascript
复制
show wal_compression;

您可以在:https://postgresqlco.nf/doc/en/param/wal_compression/上查看有关此参数的更多信息。

无论如何,您的WAL压缩在酒吧一侧应该工作,因为它似乎您已配置正确的压缩。确保您已经在barman服务器上安装了pigz所需的操作系统库。

在流操作期间,您将不会看到压缩的WAL大小。WAL日志在完成流操作后将被压缩。但是您可以在WAL目录中检查已经压缩的wal日志。

命令来检查配置的wals_directory:

代码语言:javascript
复制
barman show-server <server_name_here> | grep "wals_directory"
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74062827

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档