mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-30 16:19:24 +00:00
It is a more advanced library and can deal with multi-line strings, what
allows us to present tags in a nice format. It also could nicely show
the table header, so we get rid of redundant Cluster column.
Debian/Ubuntu already have the module packaged as `python3-terminaltables`,
so it shouldn't be a problem for package maintainers.
Example output:
```bash
$ patronictl list
┌ Cluster: batman (6792870884189948744) ┬─────────┬────┬───────────┬─────────────────┬────────────────────────────┐
│ Member │ Host │ Role │ State │ TL │ Lag in MB │ Pending restart │ Tags │
├─────────────┼────────────────┼────────┼─────────┼────┼───────────┼─────────────────┼────────────────────────────┤
│ postgresql0 │ 127.0.0.1:5432 │ Leader │ running │ 2 │ │ │ │
├─────────────┼────────────────┼────────┼─────────┼────┼───────────┼─────────────────┼────────────────────────────┤
│ postgresql1 │ 127.0.0.1:5433 │ │ running │ 2 │ 0 │ │ clonefrom: true │
│ │ │ │ │ │ │ │ nofailover: true │
│ │ │ │ │ │ │ │ noloadbalance: true │
│ │ │ │ │ │ │ │ replicatefrom: postgresql0 │
├─────────────┼────────────────┼────────┼─────────┼────┼───────────┼─────────────────┼────────────────────────────┤
│ postgresql2 │ 127.0.0.1:5434 │ │ running │ 2 │ 0 │ * │ replicatefrom: postgres1 │
└─────────────┴────────────────┴────────┴─────────┴────┴───────────┴─────────────────┴────────────────────────────┘
$ patronictl list badclustername
┌ Cluster: badclustername (uninitialized) ──────┐
│ Member │ Host │ Role │ State │ TL │ Lag in MB │
└────────┴──────┴──────┴───────┴────┴───────────┘
$ patronictl history
┌────┬──────────┬──────────────────────────────┬───────────────────────────┐
│ TL │ LSN │ Reason │ Timestamp │
├────┼──────────┼──────────────────────────────┼───────────────────────────┤
│ 1 │ 25657792 │ no recovery target specified │ 2020-02-13T11:26:27+01:00 │
│ 2 │ 25690088 │ no recovery target specified │ 2020-02-13T11:29:53+01:00 │
└────┴──────────┴──────────────────────────────┴───────────────────────────┘
$ patronictl query -c "SELECT a, repeat('x', a) from generate_series(1,3) a"
┌───┬────────┐
│ a │ repeat │
├───┼────────┤
│ 1 │ x │
│ 2 │ xx │
│ 3 │ xxx │
└───┴────────┘
```
14 lines
216 B
Plaintext
14 lines
216 B
Plaintext
urllib3>=1.19.1,!=1.21
|
|
boto
|
|
PyYAML
|
|
six >= 1.7
|
|
kazoo>=1.3.1
|
|
python-etcd>=0.4.3,<0.5
|
|
python-consul>=0.7.1
|
|
click>=4.1
|
|
terminaltables>=3.1.0
|
|
python-dateutil
|
|
psutil>=2.0.0
|
|
cdiff
|
|
kubernetes>=2.0.0,<=10.0.1,!=4.0.*,!=5.0.*
|