-1

运行 [root@centos81-01 ~]#patoni pgsql11-0.yml 来设置 PostgreSQL Cluster 并得到一个错误

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)
  • 点击 (7.1.1)
  • 卡祖笛 (2.7.0)
  • 赞助人(1.6.4)
  • 点子(9.0.3)
  • 漂亮的(0.7.2)
  • psutil (5.7.0)
  • psycopg2 (2.8.3)
  • psycopg2-二进制(2.8.4)
  • python-dateutil (2.6.1)
  • 皮茨(2019.3)
  • PyYAML (5.3.1)
  • 安装工具 (39.2.0)
  • 六(1.11.0)
  • tzlocal (2.0.0)
  • urllib3 (1.25.8)

如果需要,我可以添加任何 ENV/libs 信息。

4

1 回答 1

0

通过将 kazoo 降级到 v2.6.1 解决了问题:

pip3 uninstall kazoo
pip3 install kazoo==2.6.1

Patroni 连接到 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
于 2020-03-27T15:01:54.843 回答