简体   繁体   English

Patroni 不会更改 postgresql.conf 中的 wal_level

[英]Patroni Does Not Change wal_level in postgresql.conf

I modify wal_level in patroini yaml file from replica to logical and ran the following commands.我将 patroini yaml 文件中的 wal_level 从副本修改为逻辑并运行以下命令。 However, the value was not changed in postgresql.conf.但是,postgresql.conf 中的值没有改变。 What am I missing?我错过了什么?

Is there a way to change DCS parameters?有没有办法改变 DCS 参数? I even tried to use alter database so I will have an "auto" file but that did not help either.我什至尝试使用alter database,所以我将拥有一个“自动”文件,但这也无济于事。

Your help is most appreciated非常感谢您的帮助

patronictl -c postgres.yml show-config 
patronictl -c postgres.yml edit-config 
// I also did reload here to be of safe side and then restarted cluster
patronictl -c postgres.yml restart postgres-cluster 




scope: postgres-cluster
name: aaa-pg2
namespace: /db/

restapi:
  listen: "0.0.0.0:8008"
  connect_address: "...:8008"

etcd:
  hosts: "..."
bootstrap:
  dcs:
    ttl: 30
    loop_wait: 10
    retry_timeout: 10
    maximum_lag_on_failover: 1048576
    postgresql:
      use_pg_rewind: true
      use_slots: true
      parameters:
      hot_standby: "on"
      wal_keep_segments: 8
      max_wal_senders: 5
      max_replication_slots: 5
      checkpoint_timeout: 30
      wal_level: logical

  initdb:
    - encoding: UTF8
    - data-checksums
  pg_hba:
    - "host replication replicator 127.0.0.1/32 trust"
    - "host replication replicator .../0 trust"
    - "host replication replicator .../0 trust"
    - "host all all 0.0.0.0/0 trust"
  users:
    admin:
      options:
        - createrole
        - createdb
      password: admin
log:
  dir: /opt/app/patroni/log
  level: INFO
postgresql:
  listen: "0.0.0.0:5432"
  connect_address: "...:5432"

  data_dir: /postgres_db/data
  config_dir: /postgres_db/data
  bin_dir: /usr/pgsql/bin

  authentication:
    replication:
    username: postgres
      password: aaa

    superuser:
      username: postgres
      password: bbb

  parameters:
    unix_socket_directories: "."
   # pgpass: ~/pgpass

tags:
  clonefrom: false
  nofailover: false
  noloadbalance: false
  nosync: false

Postgres is run by Patroni with the following parameters: Postgres 由 Patroni 使用以下参数运行:

ps -ef | grep postgres

/usr/pgsql/bin/postgres -D /postgres_db/data --config-file=/postgres_db/data/postgresql.conf --listen_addresses=0.0.0.0 --port=5432 --cluster_name=postgres-cluster --wal_level=replica --hot_standby=on --max_connections=100 --max_wal_senders=10 --max_prepared_transactions=0 --max_locks_per_transaction=64 --track_commit_timestamp=off --max_replication_slots=10 --max_worker_processes=8 --wal_log_hints=on

When I ran the patronictl -c postgres.yml edit-config the parameters section was not indented.当我运行patronictl -c postgres.yml edit-config 时,参数部分没有缩进。 Once I ran the command patronictl -c postgres.yml edit-config with -p option it put it in the correct indentation and now it works.一旦我使用 -p 选项运行命令patronictl -c postgres.yml edit-config ,它就会把它放在正确的缩进中,现在它可以工作了。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM