温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

postgresql关闭服务器的方法

发布时间:2020-07-16 13:45:00 来源:亿速云 阅读:363 作者:清晨 栏目:编程语言

这篇文章主要介绍postgresql关闭服务器的方法,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!

postgresql关闭服务器的方法:

[postgres@localhost ~]$ pg_ctl stop
waiting for server to shut down.... done
server stopped

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

pg_ctl stop -m smart

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

pg_ctl stop -m fast

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

pg_ctl stop -m immediate

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

以上是postgresql关闭服务器的方法的所有内容,感谢各位的阅读!希望分享的内容对大家有帮助,更多相关知识,欢迎关注亿速云行业资讯频道!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI