以下是操作过程:
[root@freelab ~]# su - postgres
Last login: Sat Jul 4 10:16:58 EDT 2020 on pts/1
-bash-4.2$ /usr/pgsql-12/bin/pg_ctl -D /postgres -l logfile start
waiting for server to start.... stopped waiting
pg_ctl: could not start server
Examine the log output.
-bash-4.2$
-bash-4.2$ date
Sat Jul 4 10:35:13 EDT 2020但是日志似乎没有得到相应的更新。
[root@freelab log]# tail -f postgresql-Sat.log
2020-07-04 09:23:14.930 EDT [1832] LOG: background worker "logical replication launcher" (PID 1840) exited with exit code 1
2020-07-04 09:23:14.930 EDT [1835] LOG: shutting down
2020-07-04 09:23:14.943 EDT [1832] LOG: received SIGHUP, reloading configuration files
2020-07-04 09:23:14.943 EDT [1832] LOG: parameter "data_directory" cannot be changed without restarting the server
2020-07-04 09:23:14.944 EDT [1832] LOG: configuration file "/postgres/postgresql.conf" contains errors; unaffected changes were applied
2020-07-04 09:23:15.052 EDT [1832] LOG: database system is shut down发布于 2020-07-04 20:45:29
当使用特定的日志文件重新启动服务器时(请参阅重新启动命令:/usr/pgsql-12/bin/pg_ctl -D /postgres -l logfile start),您需要查看特定的日志文件,而不是postgresql-Sat.log。
此外,在前面的日志中,这一行显示您修改了数据目录:
2020-07-04 :23:14.943 EDT日志:参数"data_directory“如果不重新启动服务器就不能更改。
据推测,log_directory相对于数据目录,因此在进行此更改之后,您需要查看new位置,以找到新的日志。来自文档:
log _目录 (string)当启用logging_collector时,此参数确定将在其中创建日志文件的目录。它可以指定为绝对路径,也可以相对于群集数据目录指定。此参数只能在postgresql.conf文件或服务器命令行中设置。默认情况是日志。
https://dba.stackexchange.com/questions/270376
复制相似问题