pg_ctl stop 的三种模式

pg_ctl stop
$ pg_ctl --help

Usage:
pg_ctl stop [-W] [-t SECS] [-D DATADIR] [-s] [-m SHUTDOWN-MODE]

Common options:
-D, --pgdata=DATADIR location of the database storage area
-s, --silent only print errors, no informational messages
-t, --timeout=SECS seconds to wait when using -w option
-V, --version output version information, then exit
-w wait until operation completes
-W do not wait until operation completes

Options for stop or restart:
-m, --mode=MODE MODE can be "smart", "fast", or "immediate"

Shutdown modes are:
smart quit after all clients have disconnected
fast quit directly, with proper shutdown
immediate quit without complete shutdown; will lead to recovery on restart

Allowed signal names for kill:
ABRT HUP INT QUIT TERM USR1 USR2

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
只列出了些和 stop 相关的

pg_ctl stop -m smart
-m选项可以选择三种不同的关闭方法

pg_ctl stop -m smart
1
SIGTERM "Smart"模式等待所有客户端断开连接以及任何在线备份结束。如果该服务器是热备,一旦所有的客户端已经断开连接,恢复和流复制将被终止。

pg_ctl stop -m fast
pg_ctl stop -m fast
1
SIGINT "Fast"模式(默认)不会等待客户端断开连接并且将终止进行中的在线备份。所有活动事务都被回滚并且客户端被强制断开连接,然后服务器被关闭。

pg_ctl stop -m immediate
pg_ctl stop -m immediate
1
SIGQUIT "Immediate"模式将立刻中止所有服务器进程,而不是做一次干净的关闭。这将导致下一次重启时进行一次崩溃恢复。


————————————————
版权声明:本文为CSDN博主「数据库人生」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/ctypyb2002/java/article/details/84649420

原文地址:https://www.cnblogs.com/telwanggs/p/12665212.html