我在这两台机器上安装了Patroni,在另外三台虚拟机器['http://10.A.A.191:2379','http://10.B.B.99:2379',‘http://10.C.C.170:2379’上设置了一个etcd集群,但是Patroni从systemctl开始失败。
当我使用patroni -c /etc/patroni.yml
命令启动Patroni时,会出现以下错误:
2019-12-26 16:51:38,207 DEBUG: Selection next machine in cache. Available machines: ['http://10.A.A.191:2379', 'http://10.B.B.99:2379', 'http://10.C.C.170:2379']
2019-12-26 16:51:38,207 INFO: Selected new etcd server http://10.C.C.170:2379
2019-12-26 16:51:38,208 DEBUG: Converted retries value: 0 -> Retry(total=0, connect=None, read=None, redirect=0, status=None)
2019-12-26 16:51:38,208 DEBUG: Starting new HTTP connection (1): 10.C.C.170:2379
2019-12-26 16:51:38,210 DEBUG: http://10.C.C.170:2379 "GET /v2/machines HTTP/1.1" 404 19
2019-12-26 16:51:38,211 ERROR: Failed to get list of machines from http://10.C.C.170:2379/v2: EtcdException('Bad response : 404 page not found\n',)
2019-12-26 16:51:38,211 INFO: Retrying on http://10.A.A.191:2379
2019-12-26 16:51:38,211 DEBUG: Converted retries value: 0 -> Retry(total=0, connect=None, read=None, redirect=0, status=None)
2019-12-26 16:51:38,211 DEBUG: Starting new HTTP connection (1): 10.237.132.191:2379
2019-12-26 16:51:38,214 DEBUG: http://10.A.A.191:2379 "GET /v2/machines HTTP/1.1" 404 19
2019-12-26 16:51:38,214 ERROR: Failed to get list of machines from http://10.A.A.191:2379/v2: EtcdException('Bad response : 404 page not found\n',)
2019-12-26 16:51:38,214 INFO: Retrying on http://10.B.B.99:2379
2019-12-26 16:51:38,215 DEBUG: Converted retries value: 0 -> Retry(total=0, connect=None, read=None, redirect=0, status=None)
2019-12-26 16:51:38,215 DEBUG: Starting new HTTP connection (1): 10.B.B.99:2379
2019-12-26 16:51:38,217 DEBUG: http://10.B.B.99:2379 "GET /v2/machines HTTP/1.1" 404 19
2019-12-26 16:51:38,217 ERROR: Failed to get list of machines from http://10.B.B.99:2379/v2: EtcdException('Bad response : 404 page not found\n',)
2019-12-26 16:51:38,217 INFO: waiting on etcd
问题似乎是在API级别的DEBUG: http://10.B.B.99:2379 "GET /v2/machines HTTP/1.1" 404 19
上。
从PostgreSQL主机可实现etcd:curl -s http://10.B.B.99:2380/members |jq -r
返回
[
{
"id": 730XXXXXXXXXXX000,
"peerURLs": [
"http://10.B.B.99:2380"
],
"name": "etcd1",
"clientURLs": [
"http://0.0.0.0:2379"
]
},
{
"id": 956XXXXXXXXXXX000,
"peerURLs": [
"http://10.C.C.170:2380"
],
"name": "etcd3",
"clientURLs": [
"http://0.0.0.0:2379"
]
},
{
"id": 1551XXXXXXXXXXX000,
"peerURLs": [
"http://10.A.A.191:2380"
],
"name": "etcd2",
"clientURLs": [
"http://0.0.0.0:2379"
]
}
]
ExecStart=/usr/local/bin/etcd \
--name etcd1 \
--advertise-client-urls http://0.0.0.0:2379 \
--listen-client-urls http://0.0.0.0:2379 \
--initial-advertise-peer-urls http://10.B.B.99:2380 \
--listen-peer-urls http://0.0.0.0:2380 \
--initial-cluster etcd1=http://10.B.B.99:2380,etcd2=http://10.A.A.191:2380,etcd3=http://10.C.C.170:2380 \
--initial-cluster-token etcd-cluster-atom \
--initial-cluster-state new \
--logger zap \
--log-outputs stdout \
--log-level debug
有人能帮我吗?
怎么啦?
非常感谢
版本:
电子表格版本: 3.4.0
etcdctl版本: 3.4.0
API版本: 3.4
patroni 1.6.3
python=0.4.5
发布于 2019-12-27 11:03:21
多亏了CyberDem0n。
etcd1启动命令中有两个问题:
API版本
Etcd v3.4默认的API版本是v3。
Patroni目前不支持v3 API。
默认情况下,Etcd 3.4关闭了API v2。
我在三个etcd.service上添加了--启用-v2=true标志--这个错误是固定的。
对于每个etcd服务器,我将0.0.0.0替换为--advertise-client-urls
标志上的实际etcd服务器ip (如示例中的--advertise-client-urls http://10.B.B.99:2379
)。
https://dba.stackexchange.com/questions/256317
复制相似问题