mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-09-02 09:39:23 +00:00
The only python-etcd3 client working directly via gRPC still supports only a single endpoint, which is not very nice for high-availability. Since Patroni is already using a heavily hacked version of python-etcd with smart retries and auto-discovery out-of-the-box, I decided to enhance the existing code with limited support of v3 protocol via gRPC-gateway. Unfortunately, watches via gRPC-gateway requires us to open and keep the second connection to the etcd. Known limitations: * The very minimal supported version is 3.0.4. On earlier versions transactions don't work due to bugs in grpc-gateway. Without transactions we can't do atomic operations, i.e. leader locks. * Watches work only starting from 3.1.0 * Authentication works only starting from 3.3.0 * gRPC-gateway does not support authentication using TLS Common Name. This is because gRPC-proxy terminates TLS from its client so all the clients share a cert of the proxy: https://github.com/etcd-io/etcd/blob/master/Documentation/op-guide/authentication.md#using-tls-common-name
15 lines
450 B
Bash
15 lines
450 B
Bash
PATRONI_SCOPE=demo
|
|
PATRONI_ETCD3_HOSTS='etcd1:2379','etcd2:2379','etcd3:2379'
|
|
|
|
PATRONI_RESTAPI_USERNAME=admin
|
|
PATRONI_RESTAPI_PASSWORD=admin
|
|
PATRONI_SUPERUSER_USERNAME=postgres
|
|
PATRONI_SUPERUSER_PASSWORD=postgres
|
|
PATRONI_REPLICATION_USERNAME=replicator
|
|
PATRONI_REPLICATION_PASSWORD=replicate
|
|
PATRONI_admin_PASSWORD=admin
|
|
PATRONI_admin_OPTIONS=createdb,createrole
|
|
|
|
# for etcdctl
|
|
ETCDCTL_ENDPOINTS=http://etcd1:2379,http://etcd2:2379,http://etcd3:2379
|