0

Here is a screen shot of patroni.service status: enter image description here

Following is the configuration of my patroni.yml:

scope: pg_cluster
namespace: /service/
name: patroni1

restapi:
    listen: 192.168.56.11:8008
    connect_address: 192.168.56.11:8008

etcd:
    hosts: 192.168.56.11:2379,192.168.56.12:2379,192.168.56.13:2379

bootstrap:
  dcs:
    ttl: 30
    loop_wait: 10
    retry_timeout: 10
    maximum_lag_on_failover: 1048576
    postgresql:
      use_pg_rewind: true
      use_slots: true
      parameters:

  initdb:
  - encoding: UTF8
  - data-checksums

  pg_hba:
  - host replication replicator 127.0.0.1/32 md5
  - host replication replicator 192.168.56.11/0 md5
  - host replication replicator 192.168.56.12/0 md5
  - host replication replicator 192.168.56.13/0 md5
  - host all all 0.0.0.0/0 md5

  users:
    admin:
      password: admin
      options:
        - createrole
        - createdb

postgresql:
  listen: 192.168.56.11:5432
  connect_address: 192.168.56.11:5432
  data_dir: /usr/local/pgsql/data/
  bin_dir: /usr/local/pgsql/bin
  pgpass: /tmp/pgpass
  authentication:
    replication:
      username: replicator
      password: replicator
    superuser:
      username: postgredbenterprise
      password: postgres

watchdog:
  mode: required
  device: /dev/watchdog
  safety_margin: 5

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

I have installed postgres from source.

I have tried changing ownership of data directory and patroni.yml file to no avail. Tried other soultions which I found over internet. But no exact answers for this particular problem.I am new to this. Can someone please tell me why I am getting this error and how to fix it?

Adelino Silva
  • 577
  • 3
  • 16
  • can you add the messages displaed when you start patroni – Adelino Silva Mar 13 '23 at 15:50
  • please give me sometime Adelino. I will add the message. – Vishwajit Bhadrashetty Mar 14 '23 at 16:09
  • No message is displayed when I start patroni. However whent I check status I get this message:Apr 21 20:20:22 patroni1 systemd[1]: Started Runners to orchestrate a high-availability PostgreSQL. Apr 21 20:20:22 patroni1 systemd[1]: patroni.service: Main process exited, code=exited, status=217/USER Apr 21 20:20:22 patroni1 systemd[1]: patroni.service: Failed with result 'exit-code'. – Vishwajit Bhadrashetty Apr 21 '23 at 15:05
  • run the sudo journalctl -u patroni.service or sudo journalctl -u patroni to see the messages from patroni service. – Adelino Silva Apr 27 '23 at 14:03
  • I get the following in the logs upon running the command suggested by you: -- Logs begin at Tue 2023-05-02 17:14:55 IST, end at Tue 2023-05-02 17:21:53 IST. -- May 02 17:21:05 patroni1 systemd[1]: Started Runners to orchestrate a high-availability PostgreSQL. May 02 17:21:05 patroni1 systemd[1]: patroni.service: Main process exited, code=exited, status=217/USER May 02 17:21:05 patroni1 systemd[1]: patroni.service: Failed with result 'exit-code'. – Vishwajit Bhadrashetty May 02 '23 at 11:52
  • Directly edited the patroni.service file under systemd folder. Added postgredbenterprise user and group and Patroni service starts now without any problems. However WAL is not taking place properly. Will update soon on WAL with proper log messages. – Vishwajit Bhadrashetty May 05 '23 at 14:20

0 Answers0