简体   繁体   English

如何更新部署在 Kube.netes pod 上的 postgresql 中的 max_connections

[英]How to update max_connections in postgresql deployed on Kubernetes pod

I want to update the max_connection count in /var/lib/postgresql/data/pgdata/postgresql.conf file, postgresql database is deployed in the form of pod.我想更新/var/lib/postgresql/data/pgdata/postgresql.conf文件中的max_connection计数,postgresql数据库以pod的形式部署。 There is no vim present inside pod to update the file, nor I could modify the Dockerfile to install vim, as I don't have access for that. pod 中没有 vim 来更新文件,我也无法修改 Dockerfile 以安装 vim,因为我无权访问它。 Also I have tried adding the args and command in the deployment.yaml file我也尝试在 deployment.yaml 文件中添加参数和命令

containers:
        - name: postgres
          image: postgres:latest
          args: ["-c", "max_connections=500"]

still no luck for it.仍然没有运气。

  1. You can use sed to edit this file?您可以使用sed来编辑这个文件吗?
  2. Some helpfull options on this thread 此线程上的一些有用选项

Just increasing max_connections is bad idea.仅仅增加max_connections是个坏主意。 You need to increase shared_buffers and kernel.shmmax as well.您还需要增加shared_bufferskernel.shmmax

Kindly refer to this SO answer here for more information.在此处参阅此 SO 答案以获取更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何通过 Kubernetes statefulset 环境变量更改 Postgresql max_connections 配置? - How to change Postgresql max_connections config via Kubernetes statefulset environment variable? Bitnami postgresql 更改 max_connections - Bitnami postgresql change max_connections 使用postgresql max_connections的Django CONN_MAX_AGE失败 - Django CONN_MAX_AGE failures with postgresql max_connections 如何优化 Postgresql max_connections 和 node-postgres 连接池? - How to optimize Postgresql max_connections and node-postgres connection pool? PostgreSQL 9.5 - 更改为 max_connections 对奴隶不可见 - PostgreSQL 9.5 - change to max_connections not being visible to slaves 查询一个参数(postgresql.conf 设置),比如“max_connections” - Query a parameter (postgresql.conf setting) like "max_connections" 没看懂文档中影响 postgresql max_connections 的描述 - Did not understand the description in the documentation that affects postgresql max_connections 我需要增加 Postgresql 中的 max_connections 吗? - Do I need to increase max_connections in Postgresql? 使用 PgBouncer 时,我应该减少 PostgreSQL 中的 max_connections 吗? - Should I decrease max_connections in PostgreSQL when using PgBouncer? 如何在我的 circleCI 配置中更新 max_connections 配置? - How can I update the max_connections config in my circleCI configuration?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM