加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

阻止PostgreSQL在Ubuntu中启动时启动

发布时间:2020-12-13 16:20:08 所属栏目:百科 来源:网络整理
导读:我正在使用PostgreSQL 9.2,它在我启动系统时自动运行(Kubuntu). 我怎么能避免这个? 我需要手动启动它,我不希望它无人值守,因为我需要查看控制台. Ubuntu或Debian可以运行PostgreSQL的多个实例,并提供自动启动/停止/启动每个群集的特定方法. 在/etc/postgres
我正在使用PostgreSQL 9.2,它在我启动系统时自动运行(Kubuntu).

我怎么能避免这个?

我需要手动启动它,我不希望它无人值守,因为我需要查看控制台.

Ubuntu或Debian可以运行PostgreSQL的多个实例,并提供自动启动/停止/启动每个群集的特定方法.

在/etc/postgresql/9.2/main(或更一般地说是/ etc / postgresql /< version> /< clustername>)中应该有一个名为start.conf的文件,其中包含以下不言自明的内容:

# Automatic startup configuration
# auto: automatically start/stop the cluster in the init script
# manual: do not start/stop in init scripts,but allow manual startup with
#         pg_ctlcluster
# disabled: do not allow manual startup with pg_ctlcluster (this can be easily
#           circumvented and is only meant to be a small protection for
#           accidents).

auto

如果您通过手动替换auto,则只能在需要时使用以下命令启动此PostgreSQL实例:

sudo pg_ctlcluster 9.2 main start

至于查看控制台,您需要的是在使用数据库时在终端中运行:

tail -f /var/log/postgresql/postgresql-9.2-main.log

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读