postgresql参数优化配置
1、官网连接
https://patroni.readthedocs.io/en/latest/dynamic_configuration.html
2、必须更改 DCS 中的共享配置,本地配置修改不生效(在一个节点执行即可)
[postgres@] patronictl -c /usr/patroni/conf/patroni_postgresql.yml edit-config loop_wait: 10 master_start_timeout: 300 maximum_lag_on_failover: 1048576 postgresql: parameters: archive_command: /bin/date archive_mode: true autovacuum: true autovacuum_max_workers: 3 bgwriter_delay: 10ms checkpoint_timeout: 30min full_page_writes: true hot_standby: true listen_addresses: '*' log_autovacuum_min_duration: -1 log_checkpoints: true log_connections: true log_destination: csvlog log_directory: log log_file_mode: 384 log_filename: postgresql-%Y-%m-%d_%H%M%S.log log_min_messages: warning log_rotation_age: 1d log_rotation_size: 10MB log_timezone: Asia/Shanghai log_truncate_on_rotation: false logging_collector: true maintenance_work_mem: 128MB max_connections: 1000 max_wal_senders: 10 max_wal_size: 1GB min_wal_size: 80MB port: 5432 random_page_cost: 2.0 seq_page_cost: 1.0 shared_buffers: 128MB superuser_reserved_connections: 3 synchronous_commit: false unix_socket_directories: /tmp unix_socket_group: '' unix_socket_permissions: 511 wal_keep_segments: 256 wal_level: logical work_mem: 4MB use_pg_rewind: true use_slots: true retry_timeout: 10 synchronous_mode: false ttl: 30
3、重启数据库集群(三个节点都执行)
[postgres@pgsql_1971 ~]$ patronictl -c /usr/patroni/conf/patroni_postgresql.yml restart batman
获取集群名称:batman