我当前的log_directory路径是
**/opt/demo/PostgreSQL/9.4/data/pg_log**
我正在尝试将日志目录路径更改为
**/logs/demo/**
当我取消注释日志路径时,服务器将无法启动,只有在默认情况下才会启动。
postgresql.conf 文件看起来像
# ERROR REPORTING AND LOGGING
#------------------------------------------------------------------------------
# - Where to Log -
log_destination = 'stderr' # Valid values are combinations of
# stderr, csvlog, syslog, and eventlog,
# This is used when logging to stderr:
logging_collector = on
# These are only used if logging_collector is on:
#log_directory = '/logs/etbos/demo/' #directorywherelogfiles are written
#log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # log file name pattern,
# These are relevant when logging to syslog:
#syslog_facility = 'LOCAL0'
#syslog_ident = 'postgres'
# This is only relevant when logging to eventlog (win32):
#event_source = 'PostgreSQL'
答案 0 :(得分:1)
所以这就是我想的:)您需要将新日志目录的权限授予postgres用户。
您可以使用f.e。:
执行此操作sudo chown postgres:postgres /your/new/log/dir/path
回答您的其他问题:
要允许来自远程主机的TCP / IP连接,您需要编辑pg_hba.conf
文件。
您可以通过添加如下所示的行来允许所有 TCP / IP连接:
host all all 0.0.0.0/32 md5
上面有五个参数,您可以在文件顶部的注释中的pg_hba.conf文件中阅读它们,但简而言之,它们意味着:
[connection_type] [database_name] [user_name] [remote_ip/mask] [auth_type]