重启postgre_postgresql如何重启

141eebb99c808cc2dd39caeaeec7e5ad.png

启动一个postgres最简单的方法是使用postgres命令(执行前请确认data目录已经被初始化完成)

服务器必须由PostgreSQL用户帐户运行,而不是由root用户或任何其他用户运行,所以先确认切换为postgres用户postgres@me:/usr/local/pgsql$ ./bin/postgres -D ./data

这个命令使得数据库在前台运行,为了使得运维数据库更加方便,包装程序pg_ctl将简化一些操作,先看看pg_ctl的帮助信息:postgres@me:/usr/local/pgsql$ ./bin/pg_ctl --help

pg_ctl is a utility to initialize, start, stop, or control a PostgreSQL server.

Usage:

pg_ctl init[db] [-D DATADIR] [-s] [-o OPTIONS]

pg_ctl start    [-D DATADIR] [-l FILENAME] [-W] [-t SECS] [-s]

[-o OPTIONS] [-p PATH] [-c]

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

pg_ctl restart  [-D DATADIR] [-m SHUTDOWN-MODE] [-W] [-t SECS] [-s]

[-o OPTIONS] [-c]

pg_ctl reload   [-D DATADIR] [-s]

pg_ctl status   [-D DATADIR]

pg_ctl promote  [-D DATADIR] [-W] [-t SECS] [-s]

pg_ctl kill     SIGNALNAME PID

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             wait until operation completes (default)

-W, --no-wait          do not wait until operation completes

-?, --help             show this help, then exit

If the -D option is omitted, the environment variable PGDATA is used.

Options for start or restart:

-c, --core-files       allow postgres to produce core files

-l, --log=FILENAME     write (or append) server log to FILENAME

-o, --options=OPTIONS  command line options to pass to postgres

(PostgreSQL server executable) or initdb

-p PATH-TO-POSTGRES    normally not necessary

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 (default)

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是一个集初始化,启动,停止,或者控制PostgreSQL服务器于一体的实用程序。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值