ccakes / nomad-pgsql-patroni

Simple container for running Postgres HA on Nomad
The Unlicense
68 stars 12 forks source link

Can not find suitable configuration of distributed configuration store #3

Closed CorentinB closed 2 years ago

CorentinB commented 2 years ago

Hi! When trying to use your work on a Nomad cluster using Consul, I'm hit with this issue popping in stderr:

2022-01-18 23:02:59,742 INFO: Failed to import patroni.dcs.etcd
2022-01-18 23:02:59,743 INFO: Failed to import patroni.dcs.etcd3
2022-01-18 23:02:59,744 INFO: Failed to import patroni.dcs.exhibitor
2022-01-18 23:02:59,746 INFO: Failed to import patroni.dcs.raft
2022-01-18 23:02:59,747 INFO: Failed to import patroni.dcs.zookeeper
Process Process-1:
Traceback (most recent call last):
  File "/usr/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/usr/lib/python3.9/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.9/dist-packages/patroni/__init__.py", line 140, in patroni_main
    abstract_main(Patroni, schema)
  File "/usr/local/lib/python3.9/dist-packages/patroni/daemon.py", line 98, in abstract_main
    controller = cls(config)
  File "/usr/local/lib/python3.9/dist-packages/patroni/__init__.py", line 30, in __init__
    self.dcs = get_dcs(self.config)
  File "/usr/local/lib/python3.9/dist-packages/patroni/dcs/__init__.py", line 110, in get_dcs
    raise PatroniFatalException("""Can not find suitable configuration of distributed configuration store
patroni.exceptions.PatroniFatalException: 'Can not find suitable configuration of distributed configuration store\nAvailable implementations: consul, kubernetes'

I simply copy pasted the job configuration in your README in my Run Job tab on the Nomad web UI, and modified consul's host value to match my consul host.

Thanks!

CorentinB commented 2 years ago

Ah! I think it was just some missing spaces for the YAML indentation in the template JSON object on the README :)

consul:
host: localhost
register_service: true

should be:

consul:
  host: localhost
  register_service: true

Here is a PR to fix it: https://github.com/ccakes/nomad-pgsql-patroni/pull/4

ccakes commented 2 years ago

Good catch! Thanks for the heads up and the PR :star_struck: