gpt4 book ai didi

postgresql - pgbouncer 端口与数据库端口

转载 作者:行者123 更新时间:2023-11-29 12:13:54 24 4
gpt4 key购买 nike

我在 php 中使用了 PostgreSQL。一段时间后,客户端连接变大,所以我尝试使用 pgbouncer 设置最大连接等。我的数据库端口是 5432,我所有的 php 使用该端口连接到我的数据库。我的问题是,如果我使用相同的端口 5432 并设置为 pgbouncer 监听端口怎么办?所以我的数据库和 pgbouncer 使用相同的端口,所以我不必更改客户端代码。谢谢

最佳答案

你不能在同一个端口上运行两个不同的应用程序,但你可以在 pgbouncer 上使用 5432 并为你的数据库使用不同的端口(例如 6432)。

要更改 postgresql 上的端口,请编辑您的 postgresql.conf:

#------------------------------------------------------------------------------
# CONNECTIONS AND AUTHENTICATION
#------------------------------------------------------------------------------

# - Connection Settings -
(...)
port = 6432 # (change requires restart)

关于postgresql - pgbouncer 端口与数据库端口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14684150/

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