Тайм-аут Patroni (kazoo), но кластер Zookeeper работает - PullRequest
0 голосов
/ 27 марта 2020

Запустите [root@centos81-01 ~] # patroni pgsql11-0.yml для настройки PostgreSQL Cluste и получите ошибку

2020-03-27 15:59:18,498 ERROR: Unhandled exception in connection loop
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/kazoo/protocol/connection.py", line 565, in _connect_attempt
    read_timeout, connect_timeout = self._connect(host, hostip, port)
TypeError: _kazoo_connect() takes 3 positional arguments but 4 were given
2020-03-27 15:59:18,499 INFO: Zookeeper session closed, state: CLOSED
Exception in thread Thread-4:
Traceback (most recent call last):
  File "/usr/lib64/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib64/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.6/site-packages/kazoo/protocol/connection.py", line 497, in zk_loop
    if retry(self._connect_loop, retry) is STOP_CONNECTING:
  File "/usr/local/lib/python3.6/site-packages/kazoo/retry.py", line 126, in __call__
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/kazoo/protocol/connection.py", line 537, in _connect_loop
    status = self._connect_attempt(host, hostip, port, retry)
  File "/usr/local/lib/python3.6/site-packages/kazoo/protocol/connection.py", line 565, in _connect_attempt
    read_timeout, connect_timeout = self._connect(host, hostip, port)
TypeError: _kazoo_connect() takes 3 positional arguments but 4 were given

Traceback (most recent call last):
  File "/usr/local/bin/patroni", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/site-packages/patroni/__init__.py", line 224, in main
    return patroni_main()
  File "/usr/local/lib/python3.6/site-packages/patroni/__init__.py", line 186, in patroni_main
    patroni = Patroni(conf)
  File "/usr/local/lib/python3.6/site-packages/patroni/__init__.py", line 31, in __init__
    self.dcs = get_dcs(self.config)
  File "/usr/local/lib/python3.6/site-packages/patroni/dcs/__init__.py", line 89, in get_dcs
    return item(config[name])
  File "/usr/local/lib/python3.6/site-packages/patroni/dcs/zookeeper.py", line 77, in __init__
    self._client.start()
  File "/usr/local/lib/python3.6/site-packages/kazoo/client.py", line 635, in start
    raise self.handler.timeout_exception("Connection time-out")
kazoo.handlers.threading.KazooTimeoutError: Connection time-out
[root@centos81-01 ~]#

На el8 CentOS Linux выпуск 8.1.1911 (Core) с

  • cdiff (1.0)
  • click (7.1.1)
  • kazoo (2.7.0)
  • patroni (1.6.4)
  • pip (9.0.3)
  • prettytable (0.7.2)
  • psutil (5.7.0)
  • psycopg2 (2.8.3)
  • psycopg2-бинарный (2.8.4)
  • python -датейтил (2.6.1)
  • pytz (2019.3)
  • PyYAML (5.3.1)
  • setuptools (39.2.0)
  • шесть (1.11.0)
  • tzlocal (2.0.0)
  • urllib3 (1.25.8)

При необходимости я могу добавить любую информацию ENV / libs.

1 Ответ

0 голосов
/ 27 марта 2020

Решена проблема с понижением kazoo до v2.6.1:

pip3 uninstall kazoo
pip3 install kazoo==2.6.1

Патроны, подключенные к Apache Zookeeper DCS Claster:

[root@centos81-01 ~]# patroni pgsql11-0.yml
2020-03-27 16:59:52,539 INFO: Connecting to 192.168.56.103:2181, use_ssl: False
2020-03-27 16:59:52,566 INFO: Zookeeper connection established, state: CONNECTED
2020-03-27 16:59:52,582 INFO: No PostgreSQL configuration items changed, nothing to reload.
2020-03-27 16:59:52,936 INFO: Lock owner: None; I am pg01
2020-03-27 16:59:53,010 INFO: trying to bootstrap a new cluster
pg_ctl: cannot be run as root
Please log in (using, e.g., "su") as the (unprivileged) user that will
own the server process.
2020-03-27 16:59:53,038 INFO: removing initialize key after failed attempt to bootstrap the cluster
2020-03-27 16:59:53,369 INFO: Lock owner: None; I am pg01
...