Patroni's unable to create the PostgreSQL data directory (/mnt/data/patroni) during initialization

13 views Asked by At

This is my patroni.yml file [root@Postgres-1 etc]# cat patroni.yml scope: postgres namespace: /db/ name: postgres-1

this name must be unique for each node to diferentiate them

Ex: postgresql1 for node 1, postgresql2 for node 2 and so on.

restapi: listen: 10.5.0.4:8008 connect_address: 10.5.0.4:8008

etcd3: host: 10.5.0.7:2379

bootstrap: dcs: ttl: 30 loop_wait: 10 retry_timeout: 10 maximum_lag_on_failover: 1048576 postgresql: use_pg_rewind: true initdb: - encoding: UTF8 - data-checksums

pg_hba:
#access rules to allow access to postgesql from network
- host replication replicator 127.0.0.1/32 md5
- host replication replicator 10.5.0.4/0 md5
- host replication replicator 10.5.0.6/0 md5
- host all all 0.0.0.0/0 md5

users:
    admin:
        password: admin
        # Password must meet internal password policies of your company
        options:
            - createrole
            - createdb

postgresql: listen: 10.5.0.4:5432 connect_address: 10.5.0.4:5432 data_dir: /mnt/data/patroni #in this folder the database files will be stored pgpass: /tmp/pgpass authentication: replication: username: replicator password: password # This is the user used internally by PostgreSQL for cluster replication # Password must meet internal password policies of your company superuser: username: postgres password: password # This initializes the password for the postgres admin user # Password must meet internal password policies of your company

parameters:
    unix_socket_directories: '.'

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

I have already created mkdir -p /mnt/data/patroni chown postgres:postgres /mnt/data/patroni chmod 700 /mnt/data/patroni

No files or directory getting created inside /mnt/data/patroni and keep on showing this log on both postgres nodes

Mar 25 02:18:46 Postgres-1 systemd[1]: Started Runners to orchestrate a high-availability PostgreSQL. Mar 25 02:18:46 Postgres-1 patroni[11614]: 2024-03-25 02:18:46,884 INFO: No PostgreSQL configuration items changed, nothing to reload. Mar 25 02:18:46 Postgres-1 patroni[11614]: 2024-03-25 02:18:46,890 INFO: Lock owner: None; I am postgres-1 Mar 25 02:18:46 Postgres-1 patroni[11614]: 2024-03-25 02:18:46,933 INFO: waiting for leader to bootstrap

[root@Postgres-1 etc]# /usr/local/bin/patronictl -c /etc/patroni.yml list

  • Cluster: postgres (7349515419481038011) --+----+-----------+ | Member | Host | Role | State | TL | Lag in MB | +------------+----------+---------+---------+----+-----------+ | postgres-1 | 10.5.0.4 | Replica | stopped | | unknown | | postgres-2 | 10.5.0.6 | Replica | stopped | | unknown |

Team, please guide me

Note: I tried changing data_dir path but still same issue.

0

There are 0 answers