AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • Início
  • system&network
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • Início
  • system&network
    • Recentes
    • Highest score
    • tags
  • Ubuntu
    • Recentes
    • Highest score
    • tags
  • Unix
    • Recentes
    • tags
  • DBA
    • Recentes
    • tags
  • Computer
    • Recentes
    • tags
  • Coding
    • Recentes
    • tags
Início / dba / Perguntas / 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

barman criando arquivos de log com proprietário incorreto

  • 772

Eu tenho o seguinte trecho de configuração no meu /etc/barman.conf:

[barman]
; System user
barman_user = ubuntu

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

No entanto, sempre que o arquivo de log é girado, isso é o que acontece:

$ 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

E barmancontinua lançando avisos/erros sobre isso:

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

A configuração do meu barman está incorreta, isso é um bug no barman ou alguma configuração de segurança no nível do sistema operacional/kernel está causando esse comportamento?

Editar: Proprietário de/var/log/barman

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

Editar: Saída debarman 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 respostas
  • 1002 Views

1 respostas

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

    Parece que você tem um /etc/logrotate.d/barmanarquivo que precisa ser editado. Procure isso, altere a linha create 0640 barman admpara create 0640 ubuntu ubuntue isso deve resolver esse problema para você.

    • 2

relate perguntas

  • Práticas recomendadas para executar a replicação atrasada do deslocamento de tempo

  • Backups de banco de dados no Oracle - Exportar o banco de dados ou usar outras ferramentas?

  • Os procedimentos armazenados impedem a injeção de SQL?

  • Sequências Biológicas do UniProt no PostgreSQL

  • Qual é a diferença entre a replicação do PostgreSQL 9.0 e o Slony-I?

Sidebar

Stats

  • Perguntas 205573
  • respostas 270741
  • best respostas 135370
  • utilizador 68524
  • Highest score
  • respostas
  • Marko Smith

    conectar ao servidor PostgreSQL: FATAL: nenhuma entrada pg_hba.conf para o host

    • 12 respostas
  • Marko Smith

    Como fazer a saída do sqlplus aparecer em uma linha?

    • 3 respostas
  • Marko Smith

    Selecione qual tem data máxima ou data mais recente

    • 3 respostas
  • Marko Smith

    Como faço para listar todos os esquemas no PostgreSQL?

    • 4 respostas
  • Marko Smith

    Listar todas as colunas de uma tabela especificada

    • 5 respostas
  • Marko Smith

    Como usar o sqlplus para se conectar a um banco de dados Oracle localizado em outro host sem modificar meu próprio tnsnames.ora

    • 4 respostas
  • Marko Smith

    Como você mysqldump tabela (s) específica (s)?

    • 4 respostas
  • Marko Smith

    Listar os privilégios do banco de dados usando o psql

    • 10 respostas
  • Marko Smith

    Como inserir valores em uma tabela de uma consulta de seleção no PostgreSQL?

    • 4 respostas
  • Marko Smith

    Como faço para listar todos os bancos de dados e tabelas usando o psql?

    • 7 respostas
  • Martin Hope
    Jin conectar ao servidor PostgreSQL: FATAL: nenhuma entrada pg_hba.conf para o host 2014-12-02 02:54:58 +0800 CST
  • Martin Hope
    Stéphane Como faço para listar todos os esquemas no PostgreSQL? 2013-04-16 11:19:16 +0800 CST
  • Martin Hope
    Mike Walsh Por que o log de transações continua crescendo ou fica sem espaço? 2012-12-05 18:11:22 +0800 CST
  • Martin Hope
    Stephane Rolland Listar todas as colunas de uma tabela especificada 2012-08-14 04:44:44 +0800 CST
  • Martin Hope
    haxney O MySQL pode realizar consultas razoavelmente em bilhões de linhas? 2012-07-03 11:36:13 +0800 CST
  • Martin Hope
    qazwsx Como posso monitorar o andamento de uma importação de um arquivo .sql grande? 2012-05-03 08:54:41 +0800 CST
  • Martin Hope
    markdorison Como você mysqldump tabela (s) específica (s)? 2011-12-17 12:39:37 +0800 CST
  • Martin Hope
    Jonas Como posso cronometrar consultas SQL usando psql? 2011-06-04 02:22:54 +0800 CST
  • Martin Hope
    Jonas Como inserir valores em uma tabela de uma consulta de seleção no PostgreSQL? 2011-05-28 00:33:05 +0800 CST
  • Martin Hope
    Jonas Como faço para listar todos os bancos de dados e tabelas usando o psql? 2011-02-18 00:45:49 +0800 CST

Hot tag

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

Explore

  • Início
  • Perguntas
    • Recentes
    • Highest score
  • tag
  • help

Footer

AskOverflow.Dev

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve