Patroni: Launch problem patroni

Created on 3 Feb 2018  路  16Comments  路  Source: zalando/patroni

Please, help. When you start patroni patroni.yml or service patroni start && service patroni status writing PatroniException: 'Can not find suitable configuration of distributed configuration store\nAvailable implementations: '
OS Debian stretch
Configured by this link

Most helpful comment

Hi,

this is very easy, either you have to install it as pip install patroni[etcd] or later you can explicitly install missing modules, i.e. pip install python-etcd

All 16 comments

Hi @vj0R,

this article is slightly outdated, starting from version 1.4 you have to specify which EXTRAS you need: https://github.com/zalando/patroni/blob/master/docs/releases.rst#version-14

Sorry, I did not see!
Thank you CyberDem0n

@CyberDem0n @vj0R
Hi,
Sorry for disturbing.
I'm fresh for Patroni, and I met the same problem when lanch Patroni:
"patroni.exceptions.PatroniException: 'Can not find suitable configuration of distributed configuration store\nAvailable implementations: '"

I do not understand what is "from version 1.4, you have to specify which EXTRAS you need"
Could you pls tell me how to do it? Do you mean I miss something in my yml file?

My system info as below:

  • CentOS 7
  • Patroni version: 1.4.4
  • etcd version: v3.3.8
  • Postgresql: 9.6.3

Attached is my yml file.

Thanks for your time!
stampede.txt

Hi,

this is very easy, either you have to install it as pip install patroni[etcd] or later you can explicitly install missing modules, i.e. pip install python-etcd

Hi CyberDem0n,

It is worked now!
Pg is started succ!
Thanks a lot for your quickly resonse!

A little question is how I can check the cluster status.
In the old times, say version 1.1
I use:
patronictl list -c /etc/patroni/stampede.yml stampede

but now there's no -c, and when I use:
patronictl list stampede
I got:
Error: 'Can not find suitable configuration of distributed configuration store\nAvailable implementations: etcd'

How can I check the cluster status?

2nd edit:
Now even I run:
patronictl show-config
It is also show:
Error: 'Can not find suitable configuration of distributed configuration store\nAvailable implementations: etcd'

But I have already installed etcd extras:
[postgres@rh1 ~]$ pip install python-etcd
Requirement already satisfied (use --upgrade to upgrade): python-etcd in /usr/lib/python2.7/site-packages
Requirement already satisfied (use --upgrade to upgrade): urllib3>=1.7.1 in /usr/lib/python2.7/site-packages/urllib3-1.23-py2.7.egg (from python-etcd)
Requirement already satisfied (use --upgrade to upgrade): dnspython>=1.13.0 in /usr/lib/python2.7/site-packages (from python-etcd)

@CyberDem0n

I have python-etcd and python-consul installed but still get

root@elmed00:/home/user# patronictl -c /etc/patroni/11-patroni.yml list 11-pg_cluster consul
Error: 'Can not find suitable configuration of distributed configuration store\nAvailable implementations: zookeeper, exhibitor, etcd, consul'

What can it be?

I'm also running into this error with latest version of all installed:

Error: 'Can not find suitable configuration of distributed configuration store\nAvailable implementations: exhibitor, zookeeper, kubernetes, etcd'

There is definitely something wrong with the config file, but you are hiding it.

@CyberDem0n
Hi, I鈥檓 meet this erro with the version of 1.6.0
Error: 'Can not find suitable configuration of distributed configuration store\nAvailable implementations: etcd'
And I have python-etcd
This is my configer

scope: postgres_2
   namespace: /db_2/
   name: postgresql_a2

  restapi:
       listen: 10.95.183.160:8008
       connect_address: 10.95.183.160:8008

   etcd:
      host: 10.95.183.164: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:
      - host replication replicator 127.0.0.1/32 md5
      - host replication replicator 10.95.183.160/0 md5
      - host replication replicator 10.95.183.161/0 md5
      - host replication replicator 10.95.183.162/0 md5
      - host all all 0.0.0.0/0 md5

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

  postgresql:
      listen: 10.95.183.160:5432
      connect_address: 10.95.183.160:5432
      data_dir: /var/lib/pgsql/9.5/data
      config_dir: /var/lib/pgsql/9.5/data
      bin_dir: /usr/pgsql-9.5/bin/
      pgpass: /tmp/pgpass
      authentication:
          replication:
              username: replicator
              password: ''
          superuser:
              username: postgres
              password: ''
      parameters:
          unix_socket_directories: '.'

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

How can i fix it .
And it's seems etcd cant store the config, when I search etcdctl get postgres_2
Error: 100: Key not found (/postgres_2)
It's my etcd config

ETCD_LISTEN_PEER_URLS="http://10.95.183.164:2380" ETCD_LISTEN_CLIENT_URLS="http://10.95.183.164:2379,http://127.0.0.1:2379" ETCD_NAME="node1" ETCD_INITIAL_ADVERTISE_PEER_URLS="http://10.95.183.164:2380" ETCD_ADVERTISE_CLIENT_URLS="http://10.95.183.164:2379" ETCD_INITIAL_CLUSTER="node1=http://10.95.183.164:2380" ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster" ETCD_INITIAL_CLUSTER_STATE="new"

@qianyuyu, yaml is very sensitive to formatting, there is a space before the etcd: keyword in your config:

  restapi:
       listen: 10.95.183.160:8008
       connect_address: 10.95.183.160:8008

-  etcd:
+ etcd:
      host: 10.95.183.164:2379

  bootstrap:
      dcs:

colleagues, can someone tell me where you can read how to deploy patroni for the HA elephant.
What was able to identify:
1) did to the point (including the team itself):
sudo pip install --upgrade setuptools
at Create a Highly Available PostgreSQL Cluster Using Patroni and HAProxy

2) then did 3 teams:
sudo apt-get install postgresql
sudo apt-get install python-psycopg2
sudo apt-get install libpq-dev
from source:
You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application

3) then returned to the source from item 1 and did everything until the end
but the cartridge itself did not start and issues:
Available implementations: "" "+ ',' .join (sorted (set (available_implementations)))))
and
聽patroni.exceptions.PatroniException: 'Can not find suitable configuration of distributed configuration store \ nAvailable

if you google, then either the blog is deleted, or just a configuration that, again, doesn鈥檛 work or isn鈥檛 for this topic, or even questions that have no answers:
Failed to start patroni
and
袧械 褍写邪谢芯褋褜 蟹邪锌褍褋褌懈褌褜 锌邪褌褉芯薪懈

My configuration:
1) 172.18.106.189/28- PostgreSQL 12 on Debian 10
2) 172.18.106.185/28- PostgreSQL 12 on Debian 10
3) 172.18.106.183/28- PostgreSQL 12 on Debian 10, etcd, HAProxy

File etc\patroni.yml:
image

image

Thank you in advance!

Your config is not correctly formatted. Please take examples from this repo as reference.

Your config is not correctly formatted. Please take examples from this repo as reference.

Thanks, 褋锌邪褋懈斜芯)

I was facing a similar issue while trying to implement consul and using the puppet module: https://github.com/jadestorm/puppet-patroni

root@ubuntu1804-9:~# systemctl status patroni
* patroni.service - Runners to orchestrate a high-availability PostgreSQL
   Loaded: loaded (/lib/systemd/system/patroni.service; enabled; vendor preset: enabled)
   Active: inactive (dead)
Condition: start condition failed at Thu 2020-04-30 17:41:21 UTC; 2min 59s ago

Apr 30 17:32:34 ubuntu1804-9 patroni[27564]:     return patroni_main()
Apr 30 17:32:34 ubuntu1804-9 patroni[27564]:   File "/usr/lib/python3/dist-packages/patroni/__init__.py", line 186, in patroni_main
Apr 30 17:32:34 ubuntu1804-9 patroni[27564]:     patroni = Patroni(conf)
Apr 30 17:32:34 ubuntu1804-9 patroni[27564]:   File "/usr/lib/python3/dist-packages/patroni/__init__.py", line 31, in __init__
Apr 30 17:32:34 ubuntu1804-9 patroni[27564]:     self.dcs = get_dcs(self.config)
Apr 30 17:32:34 ubuntu1804-9 patroni[27564]:   File "/usr/lib/python3/dist-packages/patroni/dcs/__init__.py", line 103, in get_dcs
Apr 30 17:32:34 ubuntu1804-9 patroni[27564]:     Available implementations: """ + ', '.join(sorted(set(available_implementations))))
Apr 30 17:32:34 ubuntu1804-9 patroni[27564]: patroni.exceptions.PatroniException: 'Can not find suitable configuration of distributed configuration store\nAvailable implementations: etcd'

I had to manually run below command to fix the issue on ubuntu18 even tho I had consul installed
pip3 install python-consul

Hi
I'm also having the exact same error:

Jul 04 22:22:58 patroni-1 patroni[15609]:     return patroni_main()
Jul 04 22:22:58 patroni-1 patroni[15609]:   File "/usr/local/lib/python3.6/dist-packages/patroni/__init__.py", line 197, in patroni_main
Jul 04 22:22:58 patroni-1 patroni[15609]:     patroni = Patroni(conf)
Jul 04 22:22:58 patroni-1 patroni[15609]:   File "/usr/local/lib/python3.6/dist-packages/patroni/__init__.py", line 32, in __init__
Jul 04 22:22:58 patroni-1 patroni[15609]:     self.dcs = get_dcs(self.config)
Jul 04 22:22:58 patroni-1 patroni[15609]:   File "/usr/local/lib/python3.6/dist-packages/patroni/dcs/__init__.py", line 106, in get_dcs
Jul 04 22:22:58 patroni-1 patroni[15609]:     Available implementations: """ + ', '.join(sorted(set(available_implementations))))
Jul 04 22:22:58 patroni-1 patroni[15609]: patroni.exceptions.PatroniException: 'Can not find suitable configuration of distributed configuration store\nAvailable implementations: etcd'
Jul 04 22:22:58 patroni-1 systemd[1]: patroni.service: Main process exited, code=exited, status=1/FAILURE
Jul 04 22:22:58 patroni-1 systemd[1]: patroni.service: Failed with result 'exit-code'.

my config file is:

scope: postgres
namespace: /patroni/
name: patroni-1

restapi:
  listen: 0.0.0.0:8008
  connect_address: patroni-1:8008
  authentication:
      username: patroni_rest_api_user
      password: "****"
  certfile: /etc/patroni/ssl/patroni-cert.pem
  keyfile: /etc/patroni/ssl/patroni-key.pem
  cafile: /etc/patroni/ssl/ca-patroni-cert.crt
  verify_client: required

consul:
        host: localhost:8500
        token: "****"

bootstrap:
    dcs:
        ttl: 100
        loop_wait: 10
        retry_timeout: 10
        maximum_lag_on_failover: 1048576
        postgresql:
            use_pg_rewind: true
            use_slots: true
            parameters:
                    wal_level: replica
                    hot_standby: "on"
                    wal_keep_segments: 8
                    max_wal_senders: 5
                    max_replication_slots: 5
                    checkpoint_timeout: 30
    initdb:
        - encoding: UTF8
        - data-checksums
    pg_hba:
        - host replication replicator patroni-1/32 md5
        - host replication replicator patroni-2/32 md5
        - host replication replicator patroni-3/32 md5
    users:
        patroni:
            password: "****"
            options:
                - superuser
                - createrole
                - createdb
        replicator:
            password: "****"
            options:
                - replication
        rewind_user:
            password: "****"

postgresql:
    listen: 0.0.0.0:5432
    connect_address: patroni-1:5432
    data_dir: /mnt/data/postgresql/12/main
    config_dir: /mnt/data/postgresql/12/main
    bin_dir: /usr/lib/postgresql/12/bin
    pgpass: /tmp/pgpass
    authentication:
        superuser:
            username: patroni
            password: "****"
        replication:
            username: replicator
            password: "****"
        rewind:
            username: rewind_user
            password: "****"
    parameters:
        unix_socket_directories: '/tmp'
tags:
    nofailover: false
    noloadbalance: false
    clonefrom: false
    nosync: false
log:
   dir: /mnt/data/log/postgresql
   level: DEBUG

and I have python-consul installed on my machine.
What could the problem be?

Hello,

I had the same error on running patronictl, despite patroni was running well :

~# patronictl list test_cluster
Error: 'Can not find suitable configuration of distributed configuration store\nAvailable implementations: consul, etcd, etcd3, exhibitor, kubernetes, zookeeper'

I used Ansible to deploy patroni (ssh remote driven installation).

I solved the problem simply by reloading the bash session I was on (ssh).
The patronictl worked well then.

Was this page helpful?
0 / 5 - 0 ratings