AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / dba / 问题 / 192998
Accepted
Saurabh Nanda
Saurabh Nanda
Asked: 2017-12-14 03:12:30 +0800 CST2017-12-14 03:12:30 +0800 CST 2017-12-14 03:12:30 +0800 CST

酒保用错误的所有者创建日志文件

  • 772

我有以下配置片段/etc/barman.conf:

[barman]
; System user
barman_user = ubuntu

; Log location
log_file = /var/log/barman/barman.log

但是,每当轮换日志文件时,都会发生以下情况:

$ ls -l /var/log/barman/
total 860
-rw-r----- 1 barman adm         0 Dec  3 06:37 barman.log
-rw-rw-r-- 1 ubuntu ubuntu 875647 Dec  2 06:12 barman.log.1

并barman不断抛出关于此的警告/错误:

$ barman cron
2017-12-13 11:11:08,358 [11498] barman.utils WARNING: Failed opening the requested log file. Using standard error instead.

我的酒保配置是否不正确,这是酒保中的错误,还是某些操作系统/内核级安全设置导致了此行为?

编辑:拥有者/var/log/barman

$ ls -ld /var/log/barman
drwxr-x--- 2 ubuntu ubuntu 4096 Dec  3 06:37 /var/log/barman

编辑:输出barman diagnose

$ barman diagnose
2017-12-15 11:27:05,588 [3812] barman.utils WARNING: Failed opening the requested log file. Using standard error instead.
{
    "global": {
        "config": {
            "barman_home": "/home/ubuntu/barman", 
            "barman_user": "ubuntu", 
            "compression": "bzip2", 
            "configuration_files_directory": "/home/ubuntu/barman.conf.d", 
            "errors_list": [], 
            "last_backup_maximum_age": "2 WEEKS", 
            "log_file": "/var/log/barman/barman.log", 
            "log_level": "INFO", 
            "minimum_redundancy": "3", 
            "path_prefix": "/home/ubuntu/pg/bin", 
            "retention_policy": "RECOVERY WINDOW OF 4 WEEKS"
        }, 
        "system_info": {
            "barman_ver": "2.3", 
            "kernel_ver": "REDACTED", 
            "python_ver": "", 
            "release": "Distributor ID:\tUbuntu\nDescription:\tUbuntu 14.04.5 LTS\nRelease:\t14.04\nCodename:\ttrusty", 
            "rsync_ver": "rsync  version 3.1.0  protocol version 31", 
            "ssh_ver": ""
        }
    }, 
    "servers": {
        "pg": {
            "backups": {}, 
            "config": {
                "active": true, 
                "archiver": false, 
                "archiver_batch_size": 0, 
                "backup_directory": "/home/ubuntu/barman/pg", 
                "backup_method": "postgres", 
                "backup_options": "concurrent_backup", 
                "bandwidth_limit": null, 
                "barman_home": "/home/ubuntu/barman", 
                "barman_lock_directory": "/home/ubuntu/barman", 
                "basebackup_retry_sleep": 30, 
                "basebackup_retry_times": 0, 
                "basebackups_directory": "/home/ubuntu/barman/pg/base", 
                "check_timeout": 30, 
                "compression": "bzip2", 
                "conninfo": "host=REDACTED user=REDACTED dbname=REDACTED", 
                "custom_compression_filter": null, 
                "custom_decompression_filter": null, 
                "description": "pg DB", 
                "disabled": false, 
                "errors_directory": "/home/ubuntu/barman/pg/errors", 
                "immediate_checkpoint": false, 
                "incoming_wals_directory": "/home/ubuntu/barman/pg/incoming", 
                "last_backup_maximum_age": "14 days", 
                "max_incoming_wals_queue": null, 
                "minimum_redundancy": 3, 
                "msg_list": [], 
                "name": "pg", 
                "network_compression": false, 
                "parallel_jobs": 1, 
                "path_prefix": "/home/ubuntu/pg/bin", 
                "post_archive_retry_script": null, 
                "post_archive_script": null, 
                "post_backup_retry_script": null, 
                "post_backup_script": null, 
                "pre_archive_retry_script": null, 
                "pre_archive_script": null, 
                "pre_backup_retry_script": null, 
                "pre_backup_script": null, 
                "recovery_options": "", 
                "retention_policy": "window 4 w", 
                "retention_policy_mode": "auto", 
                "reuse_backup": null, 
                "slot_name": "pgbackup", 
                "ssh_command": null, 
                "streaming_archiver": true, 
                "streaming_archiver_batch_size": 0, 
                "streaming_archiver_name": "barman_receive_wal", 
                "streaming_backup_name": "barman_streaming_backup", 
                "streaming_conninfo": "host=REDACTED user=REDACTED dbname=REDACTED", 
                "streaming_wals_directory": "/home/ubuntu/barman/pg/streaming", 
                "tablespace_bandwidth_limit": null, 
                "wal_retention_policy": "simple-wal 4 w", 
                "wals_directory": "/home/ubuntu/barman/pg/wals"
            }, 
            "status": {
                "config_file": "/etc/postgresql/9.4/main/postgresql.conf", 
                "connection_error": null, 
                "current_size": 6165378560.0, 
                "current_xlog": "000000010000005A0000000D", 
                "data_directory": "/var/lib/postgresql/9.4/main", 
                "hba_file": "/etc/postgresql/9.4/main/pg_hba.conf", 
                "ident_file": "/etc/postgresql/9.4/main/pg_ident.conf", 
                "is_in_recovery": false, 
                "is_superuser": true, 
                "pg_basebackup_bwlimit": true, 
                "pg_basebackup_compatible": true, 
                "pg_basebackup_installed": true, 
                "pg_basebackup_path": "/home/ubuntu/pg/bin/pg_basebackup", 
                "pg_basebackup_tbls_mapping": true, 
                "pg_basebackup_version": "9.4.0", 
                "pg_receivexlog_compatible": true, 
                "pg_receivexlog_installed": true, 
                "pg_receivexlog_path": "/home/ubuntu/pg/bin/pg_receivexlog", 
                "pg_receivexlog_supports_slots": true, 
                "pg_receivexlog_synchronous": false, 
                "pg_receivexlog_version": "9.4.0", 
                "pgespresso_installed": false, 
                "replication_slot": [
                    "pgbackup", 
                    true, 
                    "5A/D000000"
                ], 
                "replication_slot_support": true, 
                "server_txt_version": "9.4.4", 
                "streaming": true, 
                "streaming_supported": true, 
                "synchronous_standby_names": [
                    ""
                ], 
                "systemid": "6202911203760332717", 
                "timeline": 1, 
                "wal_level": "hot_standby", 
                "xlogpos": "5A/D4E6CA8"
            }, 
            "wals": {
                "last_archived_wal_per_timeline": {
                    "00000001": {
                        "compression": "bzip2", 
                        "name": "000000010000005A0000000C", 
                        "size": 1679, 
                        "time": 1513163133.925488
                    }
                }
            }
        }
    }
}
2017-12-15 11:27:07,611 [3812] barman.diagnose INFO: {
    "global": {
        "config": {
            "barman_home": "/home/ubuntu/barman", 
            "barman_user": "ubuntu", 
            "compression": "bzip2", 
            "configuration_files_directory": "/home/ubuntu/barman.conf.d", 
            "errors_list": [], 
            "last_backup_maximum_age": "2 WEEKS", 
            "log_file": "/var/log/barman/barman.log", 
            "log_level": "INFO", 
            "minimum_redundancy": "3", 
            "path_prefix": "/home/ubuntu/pg/bin", 
            "retention_policy": "RECOVERY WINDOW OF 4 WEEKS"
        }, 
        "system_info": {
            "barman_ver": "2.3", 
            "kernel_ver": "REDACTED", 
            "python_ver": "", 
            "release": "Distributor ID:\tUbuntu\nDescription:\tUbuntu 14.04.5 LTS\nRelease:\t14.04\nCodename:\ttrusty", 
            "rsync_ver": "rsync  version 3.1.0  protocol version 31", 
            "ssh_ver": ""
        }
    }, 
    "servers": {
        "pg": {
            "backups": {}, 
            "config": {
                "active": true, 
                "archiver": false, 
                "archiver_batch_size": 0, 
                "backup_directory": "/home/ubuntu/barman/pg", 
                "backup_method": "postgres", 
                "backup_options": "concurrent_backup", 
                "bandwidth_limit": null, 
                "barman_home": "/home/ubuntu/barman", 
                "barman_lock_directory": "/home/ubuntu/barman", 
                "basebackup_retry_sleep": 30, 
                "basebackup_retry_times": 0, 
                "basebackups_directory": "/home/ubuntu/barman/pg/base", 
                "check_timeout": 30, 
                "compression": "bzip2", 
                "conninfo": "host=REDACTED user=REDACTED dbname=REDACTED", 
                "custom_compression_filter": null, 
                "custom_decompression_filter": null, 
                "description": "pg DB", 
                "disabled": false, 
                "errors_directory": "/home/ubuntu/barman/pg/errors", 
                "immediate_checkpoint": false, 
                "incoming_wals_directory": "/home/ubuntu/barman/pg/incoming", 
                "last_backup_maximum_age": "14 days", 
                "max_incoming_wals_queue": null, 
                "minimum_redundancy": 3, 
                "msg_list": [], 
                "name": "pg", 
                "network_compression": false, 
                "parallel_jobs": 1, 
                "path_prefix": "/home/ubuntu/pg/bin", 
                "post_archive_retry_script": null, 
                "post_archive_script": null, 
                "post_backup_retry_script": null, 
                "post_backup_script": null, 
                "pre_archive_retry_script": null, 
                "pre_archive_script": null, 
                "pre_backup_retry_script": null, 
                "pre_backup_script": null, 
                "recovery_options": "", 
                "retention_policy": "window 4 w", 
                "retention_policy_mode": "auto", 
                "reuse_backup": null, 
                "slot_name": "pgbackup", 
                "ssh_command": null, 
                "streaming_archiver": true, 
                "streaming_archiver_batch_size": 0, 
                "streaming_archiver_name": "barman_receive_wal", 
                "streaming_backup_name": "barman_streaming_backup", 
                "streaming_conninfo": "host=REDACTED user=REDACTED dbname=REDACTED", 
                "streaming_wals_directory": "/home/ubuntu/barman/pg/streaming", 
                "tablespace_bandwidth_limit": null, 
                "wal_retention_policy": "simple-wal 4 w", 
                "wals_directory": "/home/ubuntu/barman/pg/wals"
            }, 
            "status": {
                "config_file": "/etc/postgresql/9.4/main/postgresql.conf", 
                "connection_error": null, 
                "current_size": 6165378560.0, 
                "current_xlog": "000000010000005A0000000D", 
                "data_directory": "/var/lib/postgresql/9.4/main", 
                "hba_file": "/etc/postgresql/9.4/main/pg_hba.conf", 
                "ident_file": "/etc/postgresql/9.4/main/pg_ident.conf", 
                "is_in_recovery": false, 
                "is_superuser": true, 
                "pg_basebackup_bwlimit": true, 
                "pg_basebackup_compatible": true, 
                "pg_basebackup_installed": true, 
                "pg_basebackup_path": "/home/ubuntu/pg/bin/pg_basebackup", 
                "pg_basebackup_tbls_mapping": true, 
                "pg_basebackup_version": "9.4.0", 
                "pg_receivexlog_compatible": true, 
                "pg_receivexlog_installed": true, 
                "pg_receivexlog_path": "/home/ubuntu/pg/bin/pg_receivexlog", 
                "pg_receivexlog_supports_slots": true, 
                "pg_receivexlog_synchronous": false, 
                "pg_receivexlog_version": "9.4.0", 
                "pgespresso_installed": false, 
                "replication_slot": [
                    "pgbackup", 
                    true, 
                    "5A/D000000"
                ], 
                "replication_slot_support": true, 
                "server_txt_version": "9.4.4", 
                "streaming": true, 
                "streaming_supported": true, 
                "synchronous_standby_names": [
                    ""
                ], 
                "systemid": "6202911203760332717", 
                "timeline": 1, 
                "wal_level": "hot_standby", 
                "xlogpos": "5A/D4E6CA8"
            }, 
            "wals": {
                "last_archived_wal_per_timeline": {
                    "00000001": {
                        "compression": "bzip2", 
                        "name": "000000010000005A0000000C", 
                        "size": 1679, 
                        "time": 1513163133.925488
                    }
                }
            }
        }
    }
}
postgresql backup
  • 1 1 个回答
  • 1002 Views

1 个回答

  • Voted
  1. Best Answer
    Kassandry
    2017-12-16T04:02:46+08:002017-12-16T04:02:46+08:00

    看起来您有一个/etc/logrotate.d/barman需要编辑的文件。寻找那个,将行更改create 0640 barman adm为create 0640 ubuntu ubuntu,这应该可以为您解决此问题。

    • 2

相关问题

  • 运行时间偏移延迟复制的最佳实践

  • Oracle 中的数据库备份 - 导出数据库还是使用其他工具?

  • 存储过程可以防止 SQL 注入吗?

  • PostgreSQL 中 UniProt 的生物序列

  • PostgreSQL 9.0 Replication 和 Slony-I 有什么区别?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    连接到 PostgreSQL 服务器:致命:主机没有 pg_hba.conf 条目

    • 12 个回答
  • Marko Smith

    如何让sqlplus的输出出现在一行中?

    • 3 个回答
  • Marko Smith

    选择具有最大日期或最晚日期的日期

    • 3 个回答
  • Marko Smith

    如何列出 PostgreSQL 中的所有模式?

    • 4 个回答
  • Marko Smith

    列出指定表的所有列

    • 5 个回答
  • Marko Smith

    如何在不修改我自己的 tnsnames.ora 的情况下使用 sqlplus 连接到位于另一台主机上的 Oracle 数据库

    • 4 个回答
  • Marko Smith

    你如何mysqldump特定的表?

    • 4 个回答
  • Marko Smith

    使用 psql 列出数据库权限

    • 10 个回答
  • Marko Smith

    如何从 PostgreSQL 中的选择查询中将值插入表中?

    • 4 个回答
  • Marko Smith

    如何使用 psql 列出所有数据库和表?

    • 7 个回答
  • Martin Hope
    Jin 连接到 PostgreSQL 服务器:致命:主机没有 pg_hba.conf 条目 2014-12-02 02:54:58 +0800 CST
  • Martin Hope
    Stéphane 如何列出 PostgreSQL 中的所有模式? 2013-04-16 11:19:16 +0800 CST
  • Martin Hope
    Mike Walsh 为什么事务日志不断增长或空间不足? 2012-12-05 18:11:22 +0800 CST
  • Martin Hope
    Stephane Rolland 列出指定表的所有列 2012-08-14 04:44:44 +0800 CST
  • Martin Hope
    haxney MySQL 能否合理地对数十亿行执行查询? 2012-07-03 11:36:13 +0800 CST
  • Martin Hope
    qazwsx 如何监控大型 .sql 文件的导入进度? 2012-05-03 08:54:41 +0800 CST
  • Martin Hope
    markdorison 你如何mysqldump特定的表? 2011-12-17 12:39:37 +0800 CST
  • Martin Hope
    Jonas 如何使用 psql 对 SQL 查询进行计时? 2011-06-04 02:22:54 +0800 CST
  • Martin Hope
    Jonas 如何从 PostgreSQL 中的选择查询中将值插入表中? 2011-05-28 00:33:05 +0800 CST
  • Martin Hope
    Jonas 如何使用 psql 列出所有数据库和表? 2011-02-18 00:45:49 +0800 CST

热门标签

sql-server mysql postgresql sql-server-2014 sql-server-2016 oracle sql-server-2008 database-design query-performance sql-server-2017

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve