gpt4 book ai didi

postgresql - 禁用给定 postgresql 数据库集群的简单方法是什么?

转载 作者:行者123 更新时间:2023-11-29 13:47:00 25 4
gpt4 key购买 nike

我可以使用 pg_ctlcluster ver cluster stop 停止给定集群的服务,但如果机器重新启动,它会立即重新启动。我可以做一些事情,比如更改它的 postgresql.conf 文件中的数据目录,但这对我来说有异味。

最佳答案

具有 pg_ctlcluster 的 PostgreSQL 安装(基于 Debian)寻找 start.conf文件在 /etc/postgresql/<version>/<clustername>包含这些内容:

# 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

改为手动以避免在启动时自动启动,每个集群。

关于postgresql - 禁用给定 postgresql 数据库集群的简单方法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46841319/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com